mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-15 02:49:33 +01:00
fix: the live transcript lookup targets the exact tmux session (release review)
list-panes -t '=name' with no colon is a window target to tmux, so a remote session that is gone resolved to a window of that name or to a session the name is a prefix of, and the Edit history panel moved to that session's conversation and stored its diffs. `=name:` is an exact session match, as src/remote-pane-history.ts already uses. Measured on tmux 3.4. The fake tmux in the test matched the name as a substring, so it passed with or without the colon. It now needs the exact token and answers a bare prefix the way real tmux does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
08d99da5ae
commit
81f8c8e894
2 files changed
+23
-2
No files matched your search
+5
-1
@@ -522,12 +522,16 @@ function claudeConfigDirLines(): string[] {
|
||||
* non-interactive shell may not list the directory it lives in, and a silent miss here leaves
|
||||
* the panel on the launch conversation after a `/clear`. The `export` stays inside the `$(…)`,
|
||||
* and inside this script, which runs under `sh` whatever the remote user's login shell is.
|
||||
*
|
||||
* ⚠️ `=name:` is an EXACT session match. Without the colon tmux reads a window target, so a
|
||||
* session that is gone resolves to a window of that name or a session the name is a prefix of,
|
||||
* and that session's conversation would land in this one's edit history.
|
||||
*/
|
||||
function liveClaudeIdLines(pane: RemoteClaudePane | undefined): string[] {
|
||||
if (!pane || !TMUX_NAME_PATTERN.test(pane.socket) || !TMUX_NAME_PATTERN.test(pane.sessionName)) return [];
|
||||
return [
|
||||
'live=',
|
||||
`pp=$(${withRemoteTmuxPath(`tmux -L ${shellescape(pane.socket)} list-panes -t ${shellescape(`=${pane.sessionName}`)} -F '#{pane_pid}' 2>/dev/null | head -n 1`)})`,
|
||||
`pp=$(${withRemoteTmuxPath(`tmux -L ${shellescape(pane.socket)} list-panes -t ${shellescape(`=${pane.sessionName}:`)} -F '#{pane_pid}' 2>/dev/null | head -n 1`)})`,
|
||||
"case $pp in ''|*[!0-9]*) pp= ;; esac",
|
||||
'if [ -n "$pp" ]; then',
|
||||
' tree=$(ps -A -o pid= -o ppid= 2>/dev/null)',
|
||||
|
||||
Reference in new issue
Block a user