mirror of
https://github.com/harivansh-afk/clanker-agent.git
synced 2026-04-15 03:00:44 +00:00
- Rename all package names from companion-* to clanker-* - Update npm scopes from @mariozechner to @harivansh-afk - Rename config directories .companion -> .clanker - Rename environment variables COMPANION_* -> CLANKER_* - Update all documentation, README files, and install scripts - Rename package directories (companion-channels, companion-grind, companion-teams) - Update GitHub URLs to harivansh-afk/clanker-agent - Preserve full git history from companion-cloud monorepo
3.2 KiB
3.2 KiB
Research Findings: Terminal Window Title Support
iTerm2 (macOS)
New Window Creation
tell application "iTerm"
set newWindow to (create window with default profile)
tell current session of newWindow
-- Execute command in new window
write text "cd /path && command"
end tell
return id of newWindow -- Returns window ID
end tell
Window Title Setting
Important: iTerm2's AppleScript window object has a title property that is read-only.
To set the actual window title (OS title bar), use escape sequences:
tell current session of newWindow
-- Set window title via escape sequence (OSC 2)
write text "printf '\\033]2;Team: Agent\\007'"
-- Optional: Set tab title via session name
set name to "Agent" -- This sets the tab title
end tell
Escape Sequences Reference
\033]0;Title\007- Set both icon name and window title\033]1;Title\007- Set tab title only (icon name)\033]2;Title\007- Set window title only
Required iTerm2 Settings
- Settings > Profiles > Terminal > "Terminal may set tab/window title" must be enabled
- May need to disable shell auto-title in
.zshrcor.bashrcto prevent overwriting
WezTerm (Cross-Platform)
New Window Creation
# Spawn new OS window
wezterm cli spawn --new-window --cwd /path -- env KEY=val command
# Returns pane ID, need to lookup window ID
Window Title Setting
# Set window title by window ID
wezterm cli set-window-title --window-id 1 "Team: Agent"
# Or set tab title
wezterm cli set-tab-title "Agent"
Getting Window ID
After spawning, we need to query for the window:
wezterm cli list --format json
# Returns array with pane_id, window_id, tab_id, etc.
tmux (Skipped)
tmux new-windowcreates windows within the same session- True OS window creation requires spawning a new terminal process entirely
- Not supported per user request
Zellij (Skipped)
zellij action new-tabcreates tabs within the same session- No native support for creating OS windows
- Not supported per user request
Universal Escape Sequences
All terminals supporting xterm escape sequences understand:
# Set window title (OSC 2)
printf '\033]2;My Window Title\007'
# Alternative syntax
printf '\e]2;My Window Title\a'
This is the most reliable cross-terminal method for setting window titles.
Summary Table
| Feature | iTerm2 | WezTerm | tmux | Zellij |
|---|---|---|---|---|
| New OS Window | ✅ AppleScript | ✅ CLI | ❌ | ❌ |
| Set Window Title | ✅ Escape seq | ✅ CLI | N/A | N/A |
| Set Tab Title | ✅ AppleScript | ✅ CLI | N/A | N/A |
| Get Window ID | ✅ AppleScript | ✅ CLI list | N/A | N/A |
Implementation Notes
- iTerm2: Will use AppleScript for window creation and escape sequences for title setting
- WezTerm: Will use CLI for both window creation and title setting
- Title Format:
{teamName}: {agentName}(e.g., "my-team: security-bot") - Window Tracking: Need to store window IDs separately from pane IDs for lifecycle management