Bug 362790 - Konsole sometimes receives escape codes during focus changes
Summary: Konsole sometimes receives escape codes during focus changes
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: emulation (show other bugs)
Version: 15.12.3
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords: investigated, triaged
Depends on:
Blocks:
 
Reported: 2016-05-07 19:18 UTC by bjoernv
Modified: 2020-11-05 09:28 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Konsole window with escape codes (9.12 KB, image/png)
2018-11-05 18:07 UTC, bjoernv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bjoernv 2016-05-07 19:18:27 UTC
Since some month my Konsole behaves strange.

If a foreground job (e.g. sleep) which does not listen on keyboard events is running in Konsole, I see the escape codes "^[[O" if Konsole looses the focus and "^]]I" if Konsole get's the focus.

Foreground jobs like editors receive the keyboard events too and may insert them into editor text.

Reproducible: Sometimes

Steps to Reproduce:
1. open Konsole
2. Type "sleep 1000"
3. Click in another window so that Konsole looses focus
4. Click back in the Konsole windows

Actual Results:  
You will see something like this:

> sleep 1000
^[[O^[[I^

Expected Results:  
No escape codes:

> sleep 1000

openSUSE Tumbleweed 20160504 x86_64
KDE Frameworks 5.21.0
Qt 5.5.1
German keyboard layout
System settings -> Activating windows Policy: "Click To Focus - Mouse Precedence",
Focus stealing prevention: Low, [x] Click raises active windows
Comment 1 Sebastian 2018-10-30 17:57:02 UTC
Note: I am no maintainer but from the bugsquad.

Hallo Björn,

I cannot reproduce this bug on my system.

Does the bug also happen in newer versions of konsole?
Unfortunately I do not use opensuse but kubuntu, but my systemsettings are pretty similar to yours.

System Information:
konsole 17.12.3
kde-plasma-version: 5.12.6
kde-frameworks-version: 5.44.0
qt-version: 5.9.5
Comment 2 bjoernv 2018-10-30 18:20:15 UTC
Unfortunately I currently also can not reproduce the bug. Some time ago I deleted all my Konsole configuration files:

~/.local/share/konsole
~/.local/share/kxmlgui5/konsole

After this action the bug was gone, but came back some days later. Again I deleted the configuration files. Currently I do not see the bug.

System Information:
konsole 18.08.2
kde-plasma-version: 5.14.2
kde-frameworks-version: 5.51.0
qt-version: 5.11.2
Comment 3 Sebastian 2018-10-30 18:26:27 UTC
Interesting thanks for the ultra-fast feedback!

Let's see how it goes.
If you notice the problem again please keep us updated.
We should try to trace the bug then.
Comment 4 bjoernv 2018-11-05 18:07:53 UTC
Created attachment 116109 [details]
Konsole window with escape codes

Every time when I left-click into this window, a new escape code is shown.
Comment 5 bjoernv 2018-11-05 18:10:55 UTC
The bug came back. I opened Konsole with multiple tabs. Only one tab (Konsole window) shows the escape codes "^[[O" and "^]]I". The other windows are still intact.

Before I saw the bug in the Konsole window I configured and compiles a source code (MythTV 29).

Typing "reset" to reset the terminal in the window does not help.
Comment 6 Egmont Koblinger 2018-11-06 11:34:19 UTC
This is turned on by
  echo -ne '\e[?1004h'
and off by
  echo -ne '\e[?1004l'

It's called "FocusIn/FocusOut" at http://invisible-island.net/xterm/ctlseqs/ctlseqs.html.

OP should investigate which utility turns on this behavior for them.
Comment 7 Justin Zobel 2020-11-05 04:14:52 UTC
I can't seem to recreate this issue on konsole from git master.

Can you please test and confirm if this is still an issue, thanks.
Comment 8 bjoernv 2020-11-05 09:16:50 UTC
I haven't see this bug since a long time.

System Information:
konsole 20.08.2
KDE-Plasma-Version: 5.20.2
KDE-Frameworks-Version: 5.75.0
Qt-version: 5.15.1
Comment 9 Justin Zobel 2020-11-05 09:28:43 UTC
Thanks for the update. I'm going to mark this as resolved. If anyone is still experiencing it please feel free to reopen with further info.