-
Notifications
You must be signed in to change notification settings - Fork 109
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
Support for OSC 133 escape sequence. #126
Comments
I am wondering what is actually stripping the escape sequences in the |
I added preliminary support for the @UtkarshVerma Would you like to try it out and see if it's what you're looking for? It should be easy to add other OSC 133 sequences to it as well, but I don't know how to add support for the externalpipe as I'm not sure how the sequences should behave with it. So, if you want to create that PR, you can port this commit to st-flexipatch and continue from there. |
Thanks @veltza. I have ported it to st-flexipatch and will make a PR. The prompt switching works as expected. I actually gave the command output copying some thought and realised the externalpipe modifications will be better for it because:
Maybe we could implement something like this:
@bakkeby I tried looking into it and the |
@UtkarshVerma You need to grab the OSC133 sequences and store them in the glyph attributes. And when you output the terminal buffer(s), you need to check if a glyph has OSC133 attributes and then recreate the appropriate OSC133 sequences for output. |
I wanted to use the externalpipe patch define a keymap for copying any command output from the terminal. Still, segregating commands from each other was challenging. After doing a bit of research, I found out about OSC 133 which is the escape sequence modern terminal emulators are using to do the same.
The resources below explain it well:
In a gist, these terminals rely on OSC 133 as markers left by the shell to figure out where a command starts and ends, along with their output.
I tried using the externalpipe patch to match against the OSC to grep out the commands, but noticed that the escape sequences were actually omitted from the terminal contents piped to my script.
What can we do?
foot
.<ctrl+shift+z/x>
to move between prompts, and some other binding to copy the terminal output.I prefer the second approach since we get a new keybinding to move between prompts, which would be a huge time saver. I'm already trying to read the source to introduce these changes but it's proving to be a bit hard to follow, especially after the reflow patch.
Please let me know what you think and an outline of how to do this would be really helpful. I would love to make a PR for this.
The text was updated successfully, but these errors were encountered: