llembas-term / linux (push) Canceled after 0s
The rename. Commands llembas-term, -gui, -mux-server, -setup; package llembas-term (Replaces, Conflicts and Provides llembas-tty, so installing it removes the old one); directories llembas-term; application id eu.llembas.term; the variables a pane sees LLEMBAS_TERM…; the status record llembas-term-status=1, the input mark llembas-term-input=1, the user variable llembas_term_status; the shell integration llembas-term.sh; the workflow llembas-term.yml; every changed upstream block is marked "LLeMbas TERM:". The terminal needs the engine's terminal contract 4 and says so in words with an older CLI. Carried over from the earlier name: the variables LLEMBAS_TTY… of a terminal that started this one are dropped; a configuration file of the old name is read where it is while there is none of the new, with a warning; command-history and settings-chosen are copied once into a data directory that does not exist yet (llembas-line::migrate); the set-up program prints the new line for an rc file that has the old one. Keys. Ctrl+Tab on the ask line switches the mode (the next tab anywhere else); Ctrl+Shift+M and Ctrl+Alt+M open the lists of chat and autocomplete models, also over the ask line, which then says the choice. In a pane where LLeMbas IDE says it is in front (user variable llembas_ide=1) the chords both have are sent on to it as the keyboard protocol's bytes and the terminal does nothing of its own; the terminal's palette is also on Ctrl+Shift+Alt+P. The built-in configuration honours the kitty keyboard protocol for a program that asks for it. CI: the .deb is installed over the released llembas-tty 1.0.0-beta.5; keys are pressed in a real window on Xvfb (not a gate). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
62 lines
2.0 KiB
Rust
62 lines
2.0 KiB
Rust
use std::sync::OnceLock;
|
|
|
|
static VERSION: OnceLock<&'static str> = OnceLock::new();
|
|
static TRIPLE: OnceLock<&'static str> = OnceLock::new();
|
|
|
|
pub fn assign_version_info(version: &'static str, triple: &'static str) {
|
|
VERSION.set(version).unwrap();
|
|
TRIPLE.set(triple).unwrap();
|
|
}
|
|
|
|
pub fn wezterm_version() -> &'static str {
|
|
VERSION
|
|
.get()
|
|
.unwrap_or(&"someone forgot to call assign_version_info")
|
|
}
|
|
|
|
/// LLeMbas TERM: this program's own version, from the `VERSION` file at
|
|
/// the top of the repository at build time. `wezterm_version` stays
|
|
/// WezTerm's: programs and scripts compare it to detect features.
|
|
pub fn llembas_term_version() -> &'static str {
|
|
include_str!("../../VERSION").trim()
|
|
}
|
|
|
|
/// LLeMbas TERM: what `--version` shows: our version and the WezTerm
|
|
/// version that it is based on.
|
|
pub fn llembas_term_long_version() -> &'static str {
|
|
static LONG: OnceLock<String> = OnceLock::new();
|
|
match VERSION.get() {
|
|
// Not assigned yet (the gui parses its arguments before it is):
|
|
// our own version alone.
|
|
None => llembas_term_version(),
|
|
Some(wezterm) => LONG
|
|
.get_or_init(|| format!("{} (based on WezTerm {})", llembas_term_version(), wezterm))
|
|
.as_str(),
|
|
}
|
|
}
|
|
|
|
pub fn wezterm_target_triple() -> &'static str {
|
|
TRIPLE
|
|
.get()
|
|
.unwrap_or(&"someone forgot to call assign_version_info")
|
|
}
|
|
|
|
pub fn running_under_wsl() -> bool {
|
|
#[cfg(unix)]
|
|
unsafe {
|
|
let mut name: libc::utsname = std::mem::zeroed();
|
|
if libc::uname(&mut name) == 0 {
|
|
// 'microsoft' is usually in version, in some cases it can be in release instead
|
|
// (see #7136)
|
|
let version = format!(
|
|
"{} {}",
|
|
std::ffi::CStr::from_ptr(name.version.as_ptr()).to_string_lossy(),
|
|
std::ffi::CStr::from_ptr(name.release.as_ptr()).to_string_lossy()
|
|
);
|
|
return version.to_ascii_lowercase().contains("microsoft");
|
|
}
|
|
};
|
|
|
|
false
|
|
}
|