Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSC 7 notify working directory support #24

Closed
rzhw opened this issue Nov 21, 2024 · 0 comments · Fixed by #25
Closed

OSC 7 notify working directory support #24

rzhw opened this issue Nov 21, 2024 · 0 comments · Fixed by #25
Labels
enhancement New feature or request

Comments

@rzhw
Copy link
Contributor

rzhw commented Nov 21, 2024

OSC 7 is an escape sequence to notify the terminal emulator of the program's current working directory. There is no formal spec for this. Efforts were made in freedesktop.org's terminal-wg, but these seem stalled.

However, OSC 7 is widely supported.

Here's macOS Sequoia's description of it:

Screenshot 2024-11-21 at 14 37 01

Here's a summary of findings I made of wider adoption (trying to justify why an existing application should print OSC 7):

Terminal Currently supported?
macOS Terminal Yes
Gnome Terminal Yes
KDE Konsole Yes
iTerm2 Yes
JetBrains JediTerm Yes
WezTerm Yes
Kitty Yes
Visual Studio Code Yes
Vim Yes
Neovim Yes
Midnight Commander Yes
Tmux Yes
Emacs Yes
Windows Terminal No (Primarily due to WSL edge cases)
Alacritty No

There also exist the related OSC 1337 proprietary to iTerm2, and OSC 633 proprietary to VSCode, and OSC 9;9 supported on Windows by ConEmu and Windows Terminal.

Not sure if it makes sense to support OSC 1337 and OSC 633, maybe it does make sense to support OSC 9;9 too?

I started work on a PR for just OSC 7, but it seems like to write unit tests charmbracelet/x/ansi also needs to support this, so I'll create this ticket first for referencing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant