mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-06 23:44:36 +00:00
refactor(coding-agent): add runtime host for session switching closes #2024
This commit is contained in:
parent
a3bf1eb399
commit
d86122cbd3
32 changed files with 1328 additions and 692 deletions
|
|
@ -38,6 +38,10 @@ export class FooterComponent implements Component {
|
|||
private footerData: ReadonlyFooterDataProvider,
|
||||
) {}
|
||||
|
||||
setSession(session: AgentSession): void {
|
||||
this.session = session;
|
||||
}
|
||||
|
||||
setAutoCompactEnabled(enabled: boolean): void {
|
||||
this.autoCompactEnabled = enabled;
|
||||
}
|
||||
|
|
@ -86,7 +90,7 @@ export class FooterComponent implements Component {
|
|||
const contextPercent = contextUsage?.percent !== null ? contextPercentValue.toFixed(1) : "?";
|
||||
|
||||
// Replace home directory with ~
|
||||
let pwd = process.cwd();
|
||||
let pwd = this.session.sessionManager.getCwd();
|
||||
const home = process.env.HOME || process.env.USERPROFILE;
|
||||
if (home && pwd.startsWith(home)) {
|
||||
pwd = `~${pwd.slice(home.length)}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue