elvish icon indicating copy to clipboard operation
elvish copied to clipboard

Support semantic prompts (OSC 133)

Open TheDaemoness opened this issue 1 year ago • 1 comments

What new feature should Elvish have?

There doesn't appear to be an option in edit for the elvish editor to automatically emit OSC 133 codes. These codes allow REPLs/shells to inform a terminal about the structure of their output, enabling features like those of the late Final Term or just wezterm.

This would be possible to implement oneself in rc.elv, except OSC escape codes emitted by the prompt are escaped (heh), which means OSC 133 B (the one that separates the prompt from user input) cannot be emitted at the end of the prompt. Emitting it at the end of edit:before-readline makes the prompt considered part of user input (at least by wezterm), which is unideal.

I'm not much of a Go person, but if there's maintainer interest in this feature, I could probably submit a PR for it.

Output of "elvish -version"

0.20.1+archlinux4

Code of Conduct

TheDaemoness avatar May 12 '24 04:05 TheDaemoness

Kitty's documentation: https://sw.kovidgoyal.net/kitty/shell-integration/

iandol avatar Jun 12 '24 01:06 iandol