* [2024-07-06 13:36] Max Nikulin:
On 18/06/2024 00:57, Ihor Radchenko wrote:
Max Nikulin writes:
Some shells support "semantic shell" that allows terminal applications
e.g. to copy whole command output. It is based on escape sequences.
https://gitlab.freedesktop.org/Per_Bothner/specifications/blob/master/proposals/semantic-prompts.md
I am looking at this gitlab link, and they way it is implemented is
simply setting PROMPT in a way that adds these escape sequences to the
original PROMPT value.
It does a bit more. There are escape sequences to mark user input,
program output, and to report program exit status. I had in mind support
of this protocol in comint, so Org babel session make take advantage of
it if the feature is available for a specific interpreter.
I imagine it organized in such a way that it can communicate with a
program able in the first place to talk natively with std in/out/err,
separating input, output, exit/result code and the prompt. By means
of escape sequences and a filter, a given shell can talk to that other
layer of the protocol. The insertion of escape sequences stays
possible with filters for any given shell.