Bug 384844 - Keyboard becomes silent and misbehaves after certain keys get pressed / some output is produced by the application
Summary: Keyboard becomes silent and misbehaves after certain keys get pressed / some ...
Status: RESOLVED NOT A BUG
Alias: None
Product: konsole
Classification: Applications
Component: keyboard (show other bugs)
Version: 17.04.3
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-19 09:10 UTC by Benjamin Schindler
Modified: 2018-03-04 19:42 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Bug happening live (50.84 KB, image/png)
2017-09-19 09:10 UTC, Benjamin Schindler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Schindler 2017-09-19 09:10:16 UTC
Created attachment 107902 [details]
Bug happening live

First of all, sorry for the very inspecific title. 

I very frequently run into the issue that after a certain command the keyboard behaves as follows: 

- Standard keys produce no output
- pressing enter (without having typed anything before) enters no newline, but adds the command prompt on the same line again
- Ctrl-C correctly inserts a newline
- typing a command (+ enter) executes the command. The command itself is not visible, (say ls), but the output of it is. 

I'm attaching a screenshot to show the behavior. 
Now, I know this is not enough for anyone to reproduce this. If I find a pattern that reproduces this, I'll post it. In the mean time, is there anything I can do that would give some hints of what is going wrong? I can reproduce rather frequently
Comment 1 Benjamin Schindler 2017-09-19 09:12:49 UTC
Just commenting on the bug: 

Line 1: This caused the issue this time. git log usually doesn't (just for the record)
Line 2: execute cd, and then ctrl-c
line 3: Pressing enter a lot, and then in the end asdfasdf in the end
line 4: executing konsole --version

The line containing hello was achieved executing 'echo hello'. The line below executing ls (naturally)
Comment 2 Egmont Koblinger 2017-09-19 13:36:38 UTC
This is a pretty common phenomenon if an app doesn't exit cleanly and leaves the terminal discipline at some nondefault value. You can reproduce e.g. by executing "stty -echo", and repair by blindly typing "stty echo", or more conveniently, "reset".
Comment 3 Benjamin Schindler 2017-09-19 13:44:47 UTC
Thanks a lot for the hint, it indeed enables/disables this behavior. 

Should this be treated as a konsole issue nonetheless? I'm asking because of all terminals I have used so far, konsole is the only where I have witnessed this behavior (apart from doing it explicitly using stty)
Comment 4 Egmont Koblinger 2017-09-19 13:55:22 UTC
All terminal emulators behave like this. There's nothing terminal emulators could do here, they don't know when is your shell prompt displayed and what is the desired state of the kernel's tty settings at a given point.

If you really need a workaround, you might try putting "stty sane" or something like that in your PROMPT_COMMAND environment variable. That way your shell resets the required settings just before displaying the prompt. (Honestly I have no clue why bash doesn't do it automatically, as it toggles the stty settings back and forth upon each start and termination of apps. And zsh seems to do it.)

I've never tried this and hence I cannot guarantee that it's free of side effects.
Comment 5 Ahmad Samir 2018-03-04 19:42:51 UTC
Closing as INVALID as per comment#2 and commment#3.