bugGNU Screen - Bugs: bug #57748, Screen buffers ESC keypresses...


bug #57748: Screen buffers ESC keypresses indefinitely since sgr support patch

Submitter:  None
Submitted:  Wed 05 Feb 2020 11:21:49 PM UTC
Votes: 60
Category:  Program Logic Severity:  3 - Normal
Priority:  * 5 - Normal Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Release:  4.7.0
Fixed Release:  5.0.0 Planned Release:  5.0.0
Work Required:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Tue 26 Mar 2024 11:49:38 PM UTC, comment #8: 

comment #7:

> Thank you for the patch. Please consider integrating it.

It's in master now.

Alexander Naumov <anaumov>
Group administrator
Sun 24 Mar 2024 09:28:27 PM UTC, comment #7: 

comment #6:

> Does anybody already test it? I would like to get testers feedback also :)

I quickly tested that the patch works over the master branch. Then I naively ported the patch (I'm not familiar with the GNU screen codebase) to the screen-v4 branch in order to import it in the Debian screen package. The result solves the issue for me. (Namely, the issue of a delay when pressing Esc in vim; https://superuser.com/a/1725659)

Thank you for the patch. Please consider integrating it.

Benjamin Poirier <gobenji>
Sun 30 Jul 2023 06:17:38 PM UTC, comment #6: 

Hello Hayato,
thank you for patch. In general, it looks ok.

Does anybody already test it? I would like to get testers feedback also :)

Alexander Naumov <anaumov>
Group administrator
Sat 29 Jul 2023 02:54:46 PM UTC, comment #5: 

I've worked around this issue three years by disabling the mouse but revisited it and written a draft patch today.

Please review it!

The patch is written for commit 6931ba07 of the master branch.

(file #54995)

Hayato Hiramatsu <hayatosv>
Sat 09 Jan 2021 11:55:12 PM UTC, comment #4: 

Ah, so this is what was causing that. I have a workaround if you don't use the mouse in any terminal apps:

run `infocmp -1 > termcap.txt`, remove the line that starts `kmous=`, then run `tic termcap.txt`.

I do use the mouse sometimes, so a real fix would be nice.

Tavis Ormandy <realtaviso>
Sat 09 Jan 2021 10:52:38 PM UTC, comment #3: 

Hi - I've just spotted this too, also because of Vim. I've bisected it to `fa3f485 support sgr mouse mose`.

> I'll draft a patch this weekend.

Did you ever get around to that? If so I'd be keen to try and test it out (and if not, I may have a go myself).


Chris Diamand <chrisd>
Sat 18 Jul 2020 01:18:09 PM UTC, comment #2: 

Yeah, I think the solution is to implement a timeout that triggers the "no escape sequence detected" state transition. I'll see if I can dig up a sensible timeout that other terminal emulators use.

If I get around to it, I'll draft a patch this weekend. This behavior finally became infuriating enough to me (vim user :'( here) to try fixing it.

Arjun Govindjee <arjunyg>
Tue 25 Feb 2020 06:22:07 PM UTC, comment #1: 

That seems right.

It is caused by trying to detect if there is wrong escape sequence delivered to screen.
I wonder if in this case it is not overstepping what we should do.

Amadeusz Sławiński <amade>
Group administrator
Wed 05 Feb 2020 11:21:49 PM UTC, original submission:  

Building 4.7.0 and 4.8.0 screen from source, I noticed that I must press ESC twice in vim within screen to exit insert mode. Running showkey -a I can see that the ESC keypress is not delivered to the pty within screen until a subsequent key is pressed, with no set timeout.

Reverting 40819ffe2b7ff2cbcb93d7b73d553179e57a27e1 alleviates the problem, although there is still a delay controlable by maptimeout.



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

Attach Files:

Attached Files
file #54995:  mouse_timeout_v1.patch added by hayatosv (4KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by gobenji (Posted a comment)
  • -email is unavailable- added by anaumov (Posted a comment)
  • -email is unavailable- added by hayatosv (Updated the item)
  • -email is unavailable- added by realtaviso (Posted a comment)
  • -email is unavailable- added by chrisd (Posted a comment)
  • -email is unavailable- added by arjunyg (Posted a comment)
  • -email is unavailable- added by amade (Posted a comment)
  • -email is unavailable- added by arjunyg (Voted in favor of this item)

    There are 60 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 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-03-26 anaumov CategoryNone Program Logic
        StatusReady For Test Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 5.0.0
    2023-07-30 anaumov StatusConfirmed Ready For Test
        Planned ReleaseNone 5.0.0
    2023-07-29 hayatosv Attached File- Added mouse_timeout_v1.patch, #54995
    2020-02-25 amade StatusNone Confirmed
    2020-02-05 arjunyg Carbon-Copy- Added arjunyg

    Back to the top

    Powered by Savane 3.13-0ba7.
    Corresponding source code