Rinomina: crate akode-*, cartelle akode-rs/ e akode-cli/, binario akode, ~/.akode, AKODE_* (A)
Riapplica la fase 5 di aKode (86e7c72e) sulla base ripulita:
- crate codex-* -> akode-*, codex-rs -> akode-rs, codex-cli -> akode-cli, binario e ausiliari akode;
- ~/.codex -> ~/.akode, CODEX_HOME -> AKODE_HOME, variabili CODEX_* -> AKODE_*, .codex/ -> .akode/ di progetto;
nessun fallback a ~/.codex o a CODEX_*;
- testi per l'utente "Codex" -> "aKode"; testi verso il modello e istruzioni di sistema invariati;
- snapshot insta rinominati (non ancora rigenerati).
I conflitti con la base ripulita sono stati risolti riapplicando la rinomina ai file senza le
funzioni di imeAI (script di mappa dei token per file).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
66
akode-rs/tui/tests/suite/tui_mode_picker_tests.rs
Normal file
66
akode-rs/tui/tests/suite/tui_mode_picker_tests.rs
Normal file
@@ -0,0 +1,66 @@
|
||||
//! The picker persists a preference, but only a new process adopts the renderer.
|
||||
|
||||
use super::*;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
#[test]
|
||||
fn tui_mode_picker_applies_only_after_restart() -> Result<()> {
|
||||
let root = akode_utils_cargo_bin::repo_root()?;
|
||||
let mut home = tempfile::tempdir()?;
|
||||
write_test_config(home.path(), &root)?;
|
||||
let path = home.path().join("config.toml");
|
||||
let config = std::fs::read_to_string(&path)?;
|
||||
std::fs::write(
|
||||
&path,
|
||||
format!(
|
||||
"tui.fullscreen_transcript = false\ntui.alternate_screen = \"always\"\ntui.disable_paste_burst = true\ntui.status_line = [\"thread-id\"]\n{config}"
|
||||
),
|
||||
)?;
|
||||
for (launch, current) in [false, true, false].into_iter().enumerate() {
|
||||
let mut terminal = PtyCodex::start(&root, home, &[])?;
|
||||
terminal.wait_for_startup()?;
|
||||
// The header precedes session setup; wait for the thread ID before sending commands.
|
||||
let deadline = Instant::now() + STARTUP_TIMEOUT;
|
||||
loop {
|
||||
terminal.read_output(Duration::from_millis(/*millis*/ 50))?;
|
||||
terminal.answer_startup_queries()?;
|
||||
if terminal
|
||||
.screen_contents()
|
||||
.split_whitespace()
|
||||
.any(|word| uuid::Uuid::parse_str(word).is_ok())
|
||||
{
|
||||
break;
|
||||
}
|
||||
ensure!(
|
||||
Instant::now() < deadline,
|
||||
"thread did not become ready: {}",
|
||||
terminal.screen_contents()
|
||||
);
|
||||
terminal.ensure_running()?;
|
||||
}
|
||||
assert_eq!(terminal.parser.screen().alternate_screen(), current);
|
||||
if launch == 2 {
|
||||
break;
|
||||
}
|
||||
terminal.write_input(b"/tui")?;
|
||||
terminal.wait_for_screen("/tui")?;
|
||||
terminal.write_input(b"\r")?;
|
||||
terminal.wait_for_screen("TUI mode for next launch")?;
|
||||
terminal.write_input(if current { b"\x1b[A" } else { b"\x1b[B" })?;
|
||||
terminal.write_input(b"\r")?;
|
||||
terminal.wait_for_screen(if current {
|
||||
"Saved TUI mode: Scrollback"
|
||||
} else {
|
||||
"Saved TUI mode: Fullscreen"
|
||||
})?;
|
||||
assert_eq!(terminal.parser.screen().alternate_screen(), current);
|
||||
let saved: toml::Value = toml::from_str(&std::fs::read_to_string(&path)?)?;
|
||||
assert_eq!(
|
||||
saved["tui"]["fullscreen_transcript"].as_bool(),
|
||||
Some(!current)
|
||||
);
|
||||
home = std::mem::replace(&mut terminal._codex_home, tempfile::tempdir()?);
|
||||
drop(terminal);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user