feat(tui): removed cursor positioning and refactored TUI rendering with explicit env defaults

- Removed getCursorPosition() method from Component interface and implementations, eliminating hardware cursor positioning support.
- Changed PI_HARDWARE_CURSOR environment variable default from implicit true to explicit '1' with fallback pattern.
- Changed PI_CLEAR_ON_SHRINK environment variable default from implicit false to explicit '0' with fallback pattern.
- Added screen clearing on TUI startup to prevent shell prompts from bleeding into first rendered frame.
- Refactored full-render logic into reusable fullRender() helper function.
This commit is contained in:
can1357
2026-02-06 05:18:02 +01:00
parent 3240318338
commit 7222bc1eae
23 changed files with 282 additions and 398 deletions
+5 -5
View File
@@ -235,8 +235,8 @@ async function createSessionManager(parsed: Args, cwd: string): Promise<SessionM
if (parsed.noSession) {
return SessionManager.inMemory();
}
if (parsed.session) {
const sessionArg = parsed.session;
if (typeof parsed.resume === "string") {
const sessionArg = parsed.resume;
if (sessionArg.includes("/") || sessionArg.includes("\\") || sessionArg.endsWith(".jsonl")) {
return await SessionManager.open(sessionArg, parsed.sessionDir);
}
@@ -258,7 +258,7 @@ async function createSessionManager(parsed: Args, cwd: string): Promise<SessionM
if (parsed.continue) {
return await SessionManager.continueRecent(cwd, parsed.sessionDir);
}
// --resume is handled separately (needs picker UI)
// --resume without value is handled separately (needs picker UI)
// If --session-dir provided without --continue/--resume, create new session there
if (parsed.sessionDir) {
return SessionManager.create(cwd, parsed.sessionDir);
@@ -572,8 +572,8 @@ export async function runRootCommand(parsed: Args, rawArgs: string[]): Promise<v
debugStartup("main:createSessionManager");
time("createSessionManager");
// Handle --resume: show session picker
if (parsedArgs.resume) {
// Handle --resume (no value): show session picker
if (parsedArgs.resume === true) {
const sessions = await SessionManager.list(cwd, parsedArgs.sessionDir);
time("SessionManager.list");
if (sessions.length === 0) {