bugGNU Screen - Bugs: bug #65513, Escape code handling rewrites...

 
 

bug #65513: Escape code handling rewrites codes between application and terminal

Submitter:  None
Submitted:  Mon 25 Mar 2024 12:46:16 AM UTC
   
 
Category:  Program Logic Severity:  3 - Normal
Priority:  * 5 - Normal Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Release:  None
Fixed Release:  None Planned Release:  None
Work Required:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 25 Mar 2024 12:46:16 AM UTC, original submission:  

Due to its the escape code handling resulting in an internal simulation of the effect rather than recording of the code, screen can emit different escape codes from those it was originally given. In some cases the substituted codes are not equivalent, depending on the terminal.

This is particularly noticeable with recent coreutils' colourisation of 'ls' output, as since commit 52aeae2c ("dircolors: colorize backup files with bright black"), this has potentially included aixterm rendition codes. The bug becomes evident in the linux virtual console when backup files listed are interspersed with regular files - "bright black" (ie. grey) colour is seen as expected, but regular files may be in standard white or bold white depending on whether they appear first or last.

Capturing the output of `printf '%b' "TERM=$TERM: " '\033[90m' '(90m)' '\033[0m' '(0m)' '\033[1m' '(1m)' '\033[0m' '(0m)\n'` with /usr/bin/script is informative, with "TERM=linux: ^[[90m(90m)^[[0m(0m)^[[1m(1m)^[[0m(0m)^M" resulting from output capture in the linux terminal and "TERM=screen.linux: ^[[90m(90m)^[[39m(0m)^[[1m(1m)^[[m^O(0m)^[[10;1H" from output under screen. On a monitor it is evident that the behaviour of the linux console differs from screen's internal emulation: specifically a bold attribute is also added by the former, which in this demonstration remains in effect until manually requested and then cancelled. When demonstrating with 'ls', a suitably-named executable file has a similar restorative effect.

https://unix-junkie.github.io/christmas/Comparison%20of%20Terminal%20Emulators%20-%20Colour%20Support.html suggests other graphical terminals also use this interpretation of the aixterm colour codes and may therefore be similarly affected by inappropriate substitution of the 'sgr0' escape sequence.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

No changes have been made to this item

Back to the top

Powered by Savane 3.13-12ab.
Corresponding source code