question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DECSTR handling corrupts screen

See original GitHub issue

It seems that although the default behaviour for DECSTR is to reset cursor position, other terminals (xterm, macOS terminal, gnome-terminal) don’t do this. In particular, GNU screen issues DECSTR before going into alternate screen mode, and after returning from it, the cursor ends up in 0;0, writing over old screen contents. Here’s an output dump from an actual GNU screen in-and-out (JS string, can be fed straight into xterm):

" root@gpu-box:~# screen -x\r\n\u001b[!p\u001b[?3;4l\u001b[4l\u001b>\u001b[?1049h\u001b[22;0;0t\u001b[4l\u001b[?1h\u001b=\u001b[0m\u001b(B\u001b[1;40r\u001b[H\u001b[2J\u001b[H\u001b[2Jroot@gpu-box:~#\r\nroot@gpu-box:~# l\r\n1.py \u001b[1m\u001b[35mkitten.jpg\u001b[2C\u001b[34mNVIDIA_CUDA-10.1_Samples\u001b[0m/\r\nroot@gpu-box:~# \r\u001b[36B\u001b[7mReally kill this window [y/n]\u001b[27m\u001b[K\r \u001b[4;20H\u001b[?1l\u001b>\u001b[40;1H\r\n\u001b[?1049l[screen is terminating]\r\nroot@gpu-box:~# "

Here’s a simple repro:

"one \u001b[!p \u001b[?1049h \u001b[?1049l two"

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jerchcommented, Mar 1, 2020

@Eugeny Should be fixed in #2746.

0reactions
jerchcommented, Mar 1, 2020

Oh well, seems the docs were interpreted wrong in this regard. Looking at DEC STD 070 it clearly states:

DECSTR has no affect on the Active Position.

Regarding the cursor DECOM and DECSC are reset, I guess DECSC got misinterpreted as resetting the active cursor position. But it should only reset the values stored in the cursor save structure to the home position (thus a following DECRC would move the cursor to home).

Read more comments on GitHub >

github_iconTop Results From Across the Web

hterm Control Sequences
The GR pointer, while tracked, does not actually get processed. When running in a UTF8 environment, it's easy to corrupt codeunits in a...
Read more >
simple image display (#12) · Issues · terminal-wg ...
My current dumb implementation just applies this as well leading to weird "image line reflowing". This needs further investigation how to deal ......
Read more >
10581: Corrupted Start screen experience and how to fix
The workaround is to swipe down from the top to bring up Action Center (which won't be corrupted) then Settings > Personalization >...
Read more >
Astrometry multiprocessing
I have tried, it partially works, but seems to me that when writing results to a fits file it gets corrupted. For example,...
Read more >
dec_vt220_codes.txt
Using the terminal monitor mode, I saw it do the following: - Delete ... rather TPU) is quite a bit more efficient in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found