Bug 459040 - Text reflow eliminates tabs at window width
Summary: Text reflow eliminates tabs at window width
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: history (show other bugs)
Version: 21.12.3
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-13 03:12 UTC by AndrolGenhald
Modified: 2022-09-16 07:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Unmaximized konsole window reproduction (37.13 KB, image/png)
2022-09-13 03:12 UTC, AndrolGenhald
Details

Note You need to log in before you can comment on or make changes to this bug.
Description AndrolGenhald 2022-09-13 03:12:50 UTC
Created attachment 152014 [details]
Unmaximized konsole window reproduction

SUMMARY
Text reflow causes tabs at the start of the line to be removed.

STEPS TO REPRODUCE
1. Execute `printf "%0.s " {1..109}; echo -e "1\t2"` in konsole (substituting 109 for konsole's character width - 1)
2. Maximize konsole
3. Note that it shows the `1` and `2` with no space in between
4. Run the same command again
5. Note that the second time there is a tab between the `1` and the `2`
6. Unmaximize konsole
7. Note that the `2` from the first execution is at the left side, while the `2` from the second execution has a tab before it

OBSERVED RESULT
Tabs behave inconsistently with text reflow based on the window size when the command is initially executed.

EXPECTED RESULT
Either tabs should always be shown even when they're at the start of a line, or they should be hidden but remembered so that they can show up again after the window is resized. Tabs that move to the start of the line due to text reflow should also behave similarly to tabs that end up at the start of a line when a command is first executed without reflow.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.24.6
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Comment 1 Bug Janitor Service 2022-09-13 12:44:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/737
Comment 2 Matan Ziv-Av 2022-09-13 13:00:26 UTC
(In reply to Bug Janitor Service from comment #1)
> A possibly relevant merge request was started @
> https://invent.kde.org/utilities/konsole/-/merge_requests/737

Sorry, please ignore this. I entered the wrong bug number.
Comment 3 Matan Ziv-Av 2022-09-13 13:19:59 UTC
(In reply to AndrolGenhald from comment #0)
> Created attachment 152014 [details]
> Unmaximized konsole window reproduction
> 
> SUMMARY
> Text reflow causes tabs at the start of the line to be removed.
> 
> STEPS TO REPRODUCE
> 1. Execute `printf "%0.s " {1..109}; echo -e "1\t2"` in konsole

About the bug itself: I am not sure it is a bug. A tab is not a printable character, but a cursor moving control code, so it is not remembered. A tab at the last character of line (or after it) is ignored.

Other reflowing terminal emulators (libvte based, wezterm, kitty) apperar to behave exactly as konsole does.
Comment 4 AndrolGenhald 2022-09-14 22:02:56 UTC
> About the bug itself: I am not sure it is a bug. A tab is not a printable
> character, but a cursor moving control code, so it is not remembered. A tab
> at the last character of line (or after it) is ignored.

Line feed isn't a printable character either, but it's pretty important to remember. I actually noticed this when I ran `cat /etc/fstab` on a machine that used tabs to align the columns, and after maximizing the window I was pretty confused for a second that the space was missing between the <dump> and <pass> options.

The current behavior makes text reflow actively detrimental when working with tab delimited data.
Comment 5 Matan Ziv-Av 2022-09-16 07:52:38 UTC
Git commit b748f4b879c3fe1c9fe12a7e860024454e6729cc by Matan Ziv-Av.
Committed on 13/09/2022 at 12:41.
Pushed by tcanabrava into branch 'release/22.08'.

Set _enableReflowLines flag from profile when switching profiles

M  +1    -1    src/session/SessionManager.cpp

https://invent.kde.org/utilities/konsole/commit/b748f4b879c3fe1c9fe12a7e860024454e6729cc
Comment 6 tcanabrava 2022-09-16 07:59:55 UTC
Git commit 2b3d46fa4ffa9d318fcb4ac1977676fd88ac9599 by Tomaz  Canabrava, on behalf of Matan Ziv-Av.
Committed on 16/09/2022 at 07:56.
Pushed by tcanabrava into branch 'master'.

Set _enableReflowLines flag from profile when switching profiles

M  +1    -1    src/session/SessionManager.cpp

https://invent.kde.org/utilities/konsole/commit/2b3d46fa4ffa9d318fcb4ac1977676fd88ac9599