Add support for VT102 Insertion-Replace Mode (IRM) #2737

Open
opened 2026-01-30 23:03:38 +00:00 by claunia · 0 comments
Owner

Originally created by @markmi on GitHub (Jul 12, 2019).

Originally assigned to: @DHowett, @lhecker on GitHub.

Insertion-Replacement Mode (IRM)

ESC  [   4   h
033 133 064 150

Set selects insert mode and turns INSERT on. New display characters move old display characters to the right. Characters moved past the right margin are lost.

ESC  [   4   l
033 133 064 154

Reset selects replace mode and turns INSERT off. New display characters replace old display characters at cursor position. The old character is erased.


original issue body follows.

The following is from recording command line editing in an ssh session to a freebsd environment (via FreeBSD's script). The displayed text is odd in Windows Terminal. First I show a textual form that shows the escape sequences and such in a readable form (I eliminated bell-ring characters from the file and other lines of text):

more ~/odd_commnd_line_editing_display.txt
ls ~/sys_typescriptsESC[1ESC[4h-ESC[4lESC[4hlESC[4lESC[4hTESC[4lESC[4hdESC[4lESC[4htESC[4lESC[4h ESC[4

A normal display in other environments (for example macOS terminal doing an ssh into FreeBSD) looks like:

cat ~/odd_commnd_line_editing_display.txt
ls -lTdt ~/sys_typescripts/

(The above shows the actual ls command that was executed.)

But under Windows Terminal (Preview) it shows:

cat ~/odd_commnd_line_editing_display.txt
ls -lTdt ~ypescripts/

This is also how it ends up looking during the command line editing,
not showing the actual text of the command to be executed: missing
some text.

The sequence is from deciding to add "-lTdt" after having typed the
path. (It was a "set -o vi" type of command line editing context.)

I was using TERM being xterm-256color on FreeBSD .

Originally created by @markmi on GitHub (Jul 12, 2019). Originally assigned to: @DHowett, @lhecker on GitHub. ### Insertion-Replacement Mode (IRM) ``` ESC [ 4 h 033 133 064 150 ``` Set selects insert mode and turns INSERT on. New display characters move old display characters to the right. Characters moved past the right margin are lost. ``` ESC [ 4 l 033 133 064 154 ``` Reset selects replace mode and turns INSERT off. New display characters replace old display characters at cursor position. The old character is erased. --- #### original issue body follows. The following is from recording command line editing in an ssh session to a freebsd environment (via FreeBSD's script). The displayed text is odd in Windows Terminal. First I show a textual form that shows the escape sequences and such in a readable form (I eliminated bell-ring characters from the file and other lines of text): > more ~/odd_commnd_line_editing_display.txt > ls ~/sys_typescriptsESC[1ESC[4h-ESC[4lESC[4hlESC[4lESC[4hTESC[4lESC[4hdESC[4lESC[4htESC[4lESC[4h ESC[4 A normal display in other environments (for example macOS terminal doing an ssh into FreeBSD) looks like: > cat ~/odd_commnd_line_editing_display.txt > ls -lTdt ~/sys_typescripts/ (The above shows the actual ls command that was executed.) But under Windows Terminal (Preview) it shows: > cat ~/odd_commnd_line_editing_display.txt > ls -lTdt ~ypescripts/ This is also how it ends up looking during the command line editing, not showing the actual text of the command to be executed: missing some text. The sequence is from deciding to add "-lTdt" after having typed the path. (It was a "set -o vi" type of command line editing context.) I was using TERM being xterm-256color on FreeBSD .
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2737