Bug 413791

Summary: Konsole output broken after escape sequences to resize are issued.
Product: [Applications] konsole Reporter: Kris S <kris>
Component: emulationAssignee: Konsole Developer <konsole-devel>
Status: REPORTED ---    
Severity: normal CC: gi1242+kde, ninjalj
Priority: NOR    
Version: 19.08.2   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Hacky way to resize konsole via DBUS

Description Kris S 2019-11-03 23:11:42 UTC
SUMMARY
When a program issues the resize escape codes to make the window larger than it is, the text area is resized, but the window is not, leaving the actual terimal content outside the viewable area, and the cursor still in the window.

STEPS TO REPRODUCE
1. Open console
2. echo -ne "\033[8;100;100t" (or any size larger than the current view

OBSERVED RESULT
The console is borked until you manually resize the window to correct the problem.

EXPECTED RESULT
Either the console is resized, or the escape sequence is ignored.

SOFTWARE/OS VERSIONS
Linux: OpenSUSE Tumbleweed
KDE Plasma Version: 5.27.1
KDE Frameworks Version: 5.63.0
Qt Version: 5.13.1
konsole version: 18.08.2
Comment 1 Kris S 2019-11-03 23:16:59 UTC
Just so there's no confusion, In the previous comment, when I said 'console' multiple times, I meant 'konsole'
Comment 2 Egmont Koblinger 2019-11-04 09:24:31 UTC
My 2 cents:

I would LOVE to see a decision (and implementation) across all popular terminal emulators to remove support for escape sequences that move, resize, iconify etc. the terminal window.

Remember when browsers allowed webpages to manipulate the browser window in this way? It was terrible. They stopped supporting these, for good reasons. We should do the same.
Comment 3 Kris S 2019-11-04 13:34:36 UTC
I agree, I set my terminal rows and columns because that's the size I want. so personally I'm quite ok with the escape code being ignored. I only found this bug because a certain program I was using triggered it. Opinions on whether or not resizing is the proper thing to do though, the actual issue is that it seems to only go halfway in konsole. It resizes the amount of rows and columns, but doesn't resize the window to match.
Comment 4 Kurt Hindenburg 2019-12-04 13:47:21 UTC
yes, the resize escape has been broken since KDE4 in the sense it has never changed the actual window size.
I've thought of removing it in the past.
Comment 5 gi1242 2022-01-13 23:44:55 UTC
gnome-terminal and xterm both support resizing the window via escape sequences. Any chance of getting it working in Konsole? (Or even a working alternative using qdbus / konsoleprofile would be much appreciated)
Comment 6 ninjalj 2022-01-15 22:39:38 UTC
Created attachment 145515 [details]
Hacky way to resize konsole via DBUS

Since comment 5 asked, here in the attachment is a hacky way to resize konsole using qdbus.
Comment 7 gi1242 2022-01-16 03:45:01 UTC
(In reply to ninjalj from comment #6)
> Created attachment 145515 [details]
> Hacky way to resize konsole via DBUS
> 
> Since comment 5 asked, here in the attachment is a hacky way to resize
> konsole using qdbus.

1,000,000 thanks!! This works perfectly for me.