Commit f19a6c1a authored by Per Bothner's avatar Per Bothner

Various shell-integration updates.

parent 74577f6d
......@@ -24,7 +24,9 @@ This specification is an extension of the protocol
first implemented by [FinalTerm]( and
then later by [iterm2](
Other similar prior art is known for
[Extraterm]( and [DomTerm](
[Extraterm](, [DomTerm](,
and [GraphTerm](
**Issue:**: The protocol needs to be tested, to see
how well it supports various shells.
......@@ -53,7 +55,7 @@ application; if that is unavailable, the name of the application.
> First do a _fresh-line_.
> Then start a new command, and enter prompt mode: Subsequent text
> (until a `OSC "133;B"` or `OSC "133;I"`command) is a prompt string.
> (until a `OSC "133;B"` or `OSC "133;I"` command) is a prompt string.
> Applicable options: `aid`, `click-move`, `repaint`.
......@@ -90,6 +92,8 @@ application; if that is unavailable, the name of the application.
> End of current command.
> Applicable options: `aid`, `cancel`.
`OSC "133;D"` [`";"` _exit-code_]`"\007"`
> Same as `OSC "133;Z"` [`";exitcode="` _exit-code_]`"\007"`.
> For backward compatibility with Iterm2/FinalTerm.
......@@ -115,7 +119,11 @@ A terminal must ignore an _option_ whose _option-name_ it doesn't recognize.
`aid=` _value_
> The current _application identifier_.
`exitcode=` _value
> A command was cancelled before execution started, for example by
> typing ctrl-c on Unix-like systems (sending `SIGINT`) during input editing.
`exitcode=` _value_
> Only applicable to a `OSC "133;Z"`command.
> Specifies an integer value that reports
> an exit code from the command. This should be a non-negative integer,
......@@ -233,6 +241,15 @@ line-wrap indicators to be correct.
**Issue**: Possibly add a way to mark indentation as distinct from prompts.
### Window re-size
Many terminals re-flow long (wrapped) lines when the containing
window changes size. It is recommended that terminal should _not_
re-flow the current input area when the cursor is in the area.
The reason is that most input editors will repaing the input area
on windows resize, and inconsistencies are possible if both
terminal and application try to re-flow, as there is no easy synchronization.
## Cursor motion from mouse clicks
People new to shells and similar REPLs usually expect that they can move
......@@ -267,11 +284,6 @@ like column position, but double-width characters only count one.)
If the count is positive, that many _right_ sequences (by default `CSI C`)
are sent; if negative, that many _left_ sequences (by default `CSI D`).
**Issue:** Some input editors can edit a multi-line input area,
and you can navigate between the lines. Translating clicks
to _down_/_up_ sequences is more complicated;
we'll discuss it a future revision, after some more experimentation.
# Open Questions
See the paragraphs starting with **Issue:**.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment