Skip to content

fix(hook): restore terminal title updates and new-tab CWD inheritance#13

Merged
moukrea merged 1 commit intomainfrom
fix/hook-title-and-cwd
Apr 13, 2026
Merged

fix(hook): restore terminal title updates and new-tab CWD inheritance#13
moukrea merged 1 commit intomainfrom
fix/hook-title-and-cwd

Conversation

@moukrea
Copy link
Copy Markdown
Owner

@moukrea moukrea commented Apr 13, 2026

Summary

  • Start inner shell as login shell (argv[0] = -bash): the PTY proxy was starting a non-login shell, so /etc/profile.d/*.sh was never sourced — breaking VTE terminal integration (__vte_prompt_command, __vte_osc7) which provides dynamic title updates and CWD tracking via OSC 0/7 escape sequences
  • Remove hardcoded static title: the one-time \x1b]0;bash\x07 was the only title the terminal ever saw, since the inner shell lacked VTE integration to send dynamic updates
  • Parse OSC 7 in relay loop: extract CWD from the inner shell's OSC 7 sequences and call set_current_dir on the proxy process, keeping /proc/<pid>/cwd current for terminal new-tab inheritance and snag cwd/snag ls
  • Fix SHLVL: decrement before exec so the inner login shell increments back to the expected level (1 instead of 2)

@moukrea moukrea merged commit b14f374 into main Apr 13, 2026
4 checks passed
@moukrea moukrea deleted the fix/hook-title-and-cwd branch April 13, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant