-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 133 (shell integration / semantic prompt) support #3064
Comments
Something like this has been on the todo list for ages:
So if you want to have a go, that would be great :-). You will need to decide what "support" means - what is tmux going to do with this information, how will the UI and commands to use the new features work, etc. |
If I was you I would probably pick a simple feature you want this to do (for example, a flag to I don't think it is necessary to go beyond the basic support for the feature (look at https://iterm2.com/documentation-escape-codes.html), the extensions in the proposal don't look of much use. |
BTW tmux has supported OSC 7 since f3dc38d, but we do not currently do anything with it apart from make it available in a format variable. |
I agree, the main selling point is being able to jump between the last commands. Other stuff like selecting the entire last output could easily be added later. For cycling between the last commands I would add the following new commands (not sure if they should have a keybinding by default).
Both would position the view such that the prompt of the respective command is the first line visible in the window (at the top of the window). |
If you add them as copy mode commands, then a key binding can be:
|
I'm closing to close this for the moment but feel free to ask here if you have any further questions, or open a PR if you have code you want me to look at. Thanks! |
Yes I will send a patch soon, don't worry I haven't abandoned the idea, just a little busy at the moment. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
It would be good if tmux supported OSC 133, which is a control sequence that specifies where the prompt ended, and where the output of the executed program starts and ends.
This can then be used for some really helpful features, such as automatically scrolling to the beginning of the output of the last shell command, cycling between the last prompt inputs or selecting the entire output of the last ran command.
The spec can be found here: https://gitlab.freedesktop.org/Per_Bothner/specifications/blob/master/proposals/semantic-prompts.md
An example terminal emulator that implements this feature is wezterm: https://wezfurlong.org/wezterm/shell-integration.html
I am mainly interested in the OSC 133 part, the OSC 7 part can be considered a separate issue.
Is this something that you would be willing to accept into the tmux codebase? If so, I can implement this myself in the near future.
This control sequence has to be supported from the shell, for example in the case of zsh one could use powerlevel10k and enable it by setting
POWERLEVEL9K_TERM_SHELL_INTEGRATION=true
.The text was updated successfully, but these errors were encountered: