Bug 436631 - Konsole prints hieroglyphs after Ctrl+C to stop (accidential) `cat foo.coredump`
Summary: Konsole prints hieroglyphs after Ctrl+C to stop (accidential) `cat foo.coredump`
Status: RESOLVED INTENTIONAL
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 21.04.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-05 13:31 UTC by postix
Modified: 2021-05-06 09:57 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot (90.58 KB, image/png)
2021-05-05 13:31 UTC, postix
Details
Screenshot 2 (710.92 KB, image/png)
2021-05-05 16:38 UTC, postix
Details
Screenshot 3 (39.05 KB, image/png)
2021-05-05 16:46 UTC, postix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description postix 2021-05-05 13:31:45 UTC
Created attachment 138167 [details]
Screenshot

SUMMARY

I accidentally executed `cat foo.coredump`  which I generated via `coredumpctl -o foo.coredump /usr/bin/foo`.
Thus I cancelled the output via `ctrl+c`. Since then, Konsole prints hieroglyphs. Please see the screenshot.


SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.81.0
Qt Version: 5.15.2
Kernel Version: 5.12.0-1-MANJARO
OS Type: 64-bit
Graphics Platform: X11

ADDITIONAL INFORMATION
Font: Hack 10 pt
Comment 1 postix 2021-05-05 13:33:11 UTC
You can observe that special characters like !"ยง$% and numbers 0123456789 are not effected.
Comment 2 postix 2021-05-05 16:38:35 UTC
Created attachment 138171 [details]
Screenshot 2

Unfortunately I was not able to reproduce this bug again, but when I tried I made stumbled over this weird issue seen in screenshot 2: Part of the output appears in front of the PS1 command line string (red rectangle) and another part behind and is indeed treated as an input, i.e. pressing enter would try to execute it. :)
Comment 3 postix 2021-05-05 16:46:40 UTC
Created attachment 138172 [details]
Screenshot 3

Sorry, in the case above the interpretation of the text behind the PS1 string as a command did not happen -- but it happened in the case I just attach here as screenshot 3, with which I am going to complete my testings.
Comment 4 postix 2021-05-05 16:59:12 UTC
Maybe this has something to do with "reflow lines on resize" option checked (though the window was always maximized) and "infinite scroll back" option checked? At least when disabling "reflow lines on resize" I could not reproduce any of the problems mentioned above, though they occurred rather rarely even when the "reflow lines on resize" was active.
Comment 5 Ahmad Samir 2021-05-05 17:10:58 UTC
I think that's the expected behaviour; you may need to reset the terminal, by issuing the `reset` command, or maybe `clear` could be enough. (There is also the Clear Terminal and Reset menu option).
Comment 6 postix 2021-05-05 17:33:28 UTC
I think I should close this bug report and split it into two distinct ones.

 For  about the issue in screenshot 2, I can easily and always reproduce it via `cat /usr/bin/konsole` :)
Comment 7 postix 2021-05-05 18:09:18 UTC
> I think that's the expected behaviour; you may need to reset the terminal, by issuing the `reset` command, or maybe `clear` could be enough. (There is also the Clear Terminal and Reset menu option).

Sorry, I hadn't seen your comment. To which issue do you refer and why is it expected? To me it sounds/looks very wrong. 

Also I forgot to mention that it's independent of the line reflow.
Comment 8 Ahmad Samir 2021-05-05 18:13:47 UTC
IIUC, cat'ing such types of files leaves the shell in a wrong state, which is why you need to reset or clear; (something similar, but on a different scale happens, if you cat a file that doesn't have a blank line at the end, the shell prompt will be displayed right next to the last text in that file, not on a new line as you'd expect).
Comment 9 postix 2021-05-05 18:25:15 UTC
I see and there's definitely no possible logic to detect and address this issue?
Comment 10 Bharadwaj Raju 2021-05-06 04:12:05 UTC
I don't think there's anything which can be done in Konsole, really. It's an issue in the shell (and the very concept of terminal escape codes) itself. Read https://unix.stackexchange.com/questions/119480/why-and-how-did-using-cat-on-binary-files-mess-up-the-terminal.
Comment 11 postix 2021-05-06 09:57:13 UTC
Thank you Ahmad and Bharadwaj for the information. Too bad! :)