bugGNU Screen - Bugs: bug #56063, pass through of escape codes to...

 
 

bug #56063: pass through of escape codes to the terminal

Submitter:  None
Submitted:  Tue 02 Apr 2019 08:46:45 PM UTC
   
 
Category:  Feature Request Severity:  3 - Normal
Priority:  * 5 - Normal Status:  Works For Me
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Release:  None
Fixed Release:  None Planned Release:  None
Work Required:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 19 Apr 2019 08:56:07 AM UTC, comment #5: 

Thanks for the help!

Some information in case others are looking:

the ocs52.sh script mentioned in the forum link:

and the important excerpt:

# Send a DCS sequence through screen.
# Usage: <sequence>
screen_dcs() {
  # Screen limits the length of string sequences, so we have to break it up.
  # Going by the screen history:
  #   (v4.2.1) Apr 2014 - today: 768 bytes
  #   Aug 2008 - Apr 2014 (v4.2.0): 512 bytes
  #   ??? - Aug 2008 (v4.0.3): 256 bytes
  # Since v4.2.0 is only ~4 years old, we'll use the 256 limit.
  # We can probably switch to the 768 limit in 2022.
  local limit=256
  # We go 4 bytes under the limit because we're going to insert two bytes
  # before (\eP) and 2 bytes after (\e\) each string.
  echo "$1" | \
    sed -E "s:.{$(( limit - 4 ))}:&\n:g" | \
    sed -E -e 's:^:\x1bP:' -e 's:$:\x1b\\:' | \
    tr -d '\n'
}


Anonymous
Sat 13 Apr 2019 03:49:38 PM UTC, comment #4: 

Also see the thread on the hterm mailing list - screen only allows a certain size to be escaped, so each chunk needs to be wrapped, instead of one large one: https://groups.google.com/a/chromium.org/forum/#!msg/chromium-hterm/J3_x2Bd5yXU/80qGVEdFEQAJ;context-place=forum/chromium-hterm

Anonymous
Sat 13 Apr 2019 02:26:33 PM UTC, comment #3: 

So, this was discussed on irc and screen has such escape code:

echo -ne "\033P...\033\\"

(It's DCS, ST sequence)

Where ... is replaced by escape code you want to pass to parent terminal.

Amadeusz Sławiński <amade>
Group administrator
Tue 02 Apr 2019 09:10:05 PM UTC, comment #2: 
Anonymous
Tue 02 Apr 2019 08:59:01 PM UTC, comment #1: 

arakiken could be a start

Anonymous
Tue 02 Apr 2019 08:46:45 PM UTC, original submission:  

I would like to have the possibility to pass escape codes unhandled through screen to the terminal.

for tmux the escape characters in the original escape codes have to be doubled.
'\033Ptmux;' is prepended to the string and '\033\\' (ESC \) is appended.

This would allow me to let the terminal handle sixel graphics but I think there are many more use cases for it.

regular sixel code:

printf '\033Pq#0;2;0;0;0#1;2;100;100;0#2;2;0;100;0#1~~@@vv@@~~@@~~$#2??}}GG}}??}}??-#1!14@\033\\'


sixel code wrapped for tmux - tmux will pass it through to the terminal:

printf '\033Ptmux;\033\033Pq#0;2;0;0;0#1;2;100;100;0#2;2;0;100;0#1~~@@vv@@~~@@~~$#2??}}GG}}??}}??-#1!14@\033\033\\\033\\'
printf '\033Pq#0;2;0;0;0#1;2;100;100;0#2;2;0;100;0#1~~@@vv@@~~@@~~$#2??}}GG}}??}}??-#1!14@\033\\' | sed 's/\o033/&&/g;s/^/\o033Ptmux;/;s/$/\o033\\/'


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

 

Carbon-Copy List
  • -email is unavailable- added by amade (Posted a comment)
  •  

    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.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-04-13 amade StatusNone Works For Me
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code