Add TFI workspace rename and directory handoff

This commit is contained in:
Kaede Akino committed 2026-09-12 10:38:00 +08:00
1 parent ef49664e87
commit fcba944911
15 files changed
+389 -41

No files matched your search

@@ -0,0 +1,14 @@
import Foundation
/// Shell commands generated from remote session context rather than typed by the user.
public nonisolated enum RemoteShellCommand {
/// Builds a one-shot directory change for a newly opened shell.
///
/// Single-quoting keeps spaces and shell punctuation inert; embedded
/// apostrophes are closed, emitted literally, and reopened.
public static func changeDirectory(to path: String) -> String? {
guard !path.isEmpty else { return nil }
let quoted = path.replacingOccurrences(of: "'", with: "'\"'\"'")
return "cd '\(quoted)'"
}
}