By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.

Bug 3028

Summary: Running Tmux in Konsole leads to screen corruption
Product: TDE Reporter: Jan Stolarek <jwstolarek>
Component: tdebaseAssignee: Timothy Pearson <kb9vqf>
Status: NEW ---    
Severity: normal CC: bugwatch, jwstolarek, michele.calgaro, slavek.banko
Priority: P5    
Version: R14.0.x [Trinity]   
Hardware: Other   
OS: Debian Buster   
Compiler Version: TDE Version String:
Application Version: Application Name:
Bug Depends on:    
Bug Blocks: 2968    
Attachments: Garbarge in Emacs
Garbarge in shell after pressing Ctrl+L
terminal text with garbage
terminal text without garbage

Description Jan Stolarek 2019-07-29 00:52:18 CDT
Created attachment 2917 [details]
Garbarge in Emacs

In Debian Buster using Tmux in Konsole leads to screen corruption. More specifically: 

1. cleaning the screen (e.g. via Ctrl+L) does not work, leaving the screen garbled

2. same thing happens in Emacs when using Ctrl+L.  When a buffer has empty lines these lines are not redrawn properly.

It looks like any kind of bulk redrawing of full lines does not work. At first I thought that this might have something to do with my tmux or .bashrc, but removing their config and running both bash and tmux on default settings leads to same results. Also, I noticed that the problem is only present in Konsole - other terminal emulators (e.g. xterm, lxterminal) work fine.  Switch to a different pane and then back to the original pane redraws the screen properly. Finally, I can reproduce this on two machines.
Comment 1 Jan Stolarek 2019-07-29 00:54:57 CDT
Created attachment 2918 [details]
Garbarge in shell after pressing Ctrl+L
Comment 2 Jan Stolarek 2019-07-29 05:25:09 CDT
It turns out that it's not only terminal redrawing that's causing problems. In some cases displaying of text on the terminal will also result in garbage. I'll attach two screenshots in a moment. First one shows some garbage. Second one shows correctly displayed text obtained after switching to a different pane and then back.
Comment 3 Jan Stolarek 2019-07-29 05:25:38 CDT
Created attachment 2919 [details]
terminal text with garbage
Comment 4 Jan Stolarek 2019-07-29 05:25:54 CDT
Created attachment 2920 [details]
terminal text without garbage
Comment 5 Michele Calgaro 2019-08-14 07:17:11 CDT
I see something similar in Konsole with looking at git logs in tde-i18n, although it seems related to some specific languages.
Slavek suggested the following patches from KDE may be helpful to look at.

https://cgit.kde.org/konsole.git/commit/?id=427de88cc1 
https://cgit.kde.org/konsole.git/commit/?id=7ff23512fd 
https://cgit.kde.org/konsole.git/commit/?id=b8a2f0cfd0 
https://cgit.kde.org/konsole.git/commit/?id=7a1116ccff
Comment 6 Jan Stolarek 2020-03-30 16:16:49 CDT
I was wondering if someone could take a look at this bug before the 14.0.8 release? This one is a major regression for me and a huge usability issue.
Comment 7 Slávek Banko 2020-04-10 04:39:57 CDT
(In reply to Jan Stolarek from comment #6)
> I was wondering if someone could take a look at this bug before the 14.0.8
> release? This one is a major regression for me and a huge usability issue.

Unfortunately this problem is more complicated and will be postponed to R14.0.9.
Comment 8 Jan Stolarek 2020-04-23 15:22:00 CDT
That's what I was afraid of. But thanks for looking into this anyway!
Comment 9 Michele Calgaro 2020-12-07 04:16:01 CST
This problem is becoming annoying... I will need to have a look at this sooner rather than later :-)
I verified the problem reported in comment 5 does not show up in xterm, so it seems Konsole specific.

Janek, can you double check if the problem with tmux is also Konsole specific (e.g. does not happen in xterm)?
Comment 10 Jan Stolarek 2020-12-07 04:23:16 CST
> Janek, can you double check if the problem with tmux is also Konsole specific (e.g. does not happen in xterm)?

Just checked and I can confirm that xterm+tmux works correct - the problem is Konsole specific.

And yes, the bug is extremely annoying. It affects me every single day given that I do 80%-90% of my work in the terminal.
Comment 11 Slávek Banko 2020-12-07 06:11:47 CST
(In reply to Jan Stolarek from comment #10)
> > Janek, can you double check if the problem with tmux is also Konsole specific (e.g. does not happen in xterm)?
> 
> Just checked and I can confirm that xterm+tmux works correct - the problem
> is Konsole specific.
> 
> And yes, the bug is extremely annoying. It affects me every single day given
> that I do 80%-90% of my work in the terminal.

Yes, I know - it bothers me too. On some machines, I temporarily downgraded tmux to an older version, but that doesn't seem to be quite sufficient either.
Comment 12 Jan Stolarek 2020-12-07 06:23:33 CST
> On some machines, I temporarily downgraded tmux to an older version, but that doesn't seem to be quite sufficient either.

By not quite sufficient do you mean that the problem still sometimes occurs or that working with an older version of tmux is not acceptable in the long term?
Comment 13 Slávek Banko 2020-12-07 07:44:42 CST
(In reply to Jan Stolarek from comment #12)
> > On some machines, I temporarily downgraded tmux to an older version, but that doesn't seem to be quite sufficient either.
> 
> By not quite sufficient do you mean that the problem still sometimes occurs
> or that working with an older version of tmux is not acceptable in the long
> term?

Yes exactly. On some systems, downgrading to tmux 2.3 seems to have eliminated the problem. But on another system even after downgrading to tmux 2.3 tmux still behaves badly. So far, I have not examined in more detail what the differences are between these systems. Instead of such research, I would rather devote time to the backport commits mentioned above. Unfortunately, I haven't had enough time yet to move forward.
Comment 14 Michele Calgaro 2020-12-07 08:05:04 CST
The problem happens also without tmux, so I believe the problem is in console.
To be clear, when I display strings in some languages (greek, russian, arab and so on), scrolling up and down leave some dirty stuff on the screen.
Is it the same issue as you are seen Janek? Or is it a different thing?

As for working on this, I will have a look. My level of annoyance with this bug has not hit the limit ;-)
Comment 15 Jan Stolarek 2020-12-07 08:27:50 CST
> To be clear, when I display strings in some languages (greek, russian, arab and so on), scrolling up and down leave some dirty stuff on the screen.

Yes, I've seen that as well (particularly, when viewing .desktop files) but it's a completely different bug, unrelated to this one. I've seen that one happen outside of tmux. As for the bug discussed here I've only seen in it happen inside tmux and I was wondering whether bisecting tmux to find the offending commit would help?
Comment 16 Slávek Banko 2020-12-07 08:45:21 CST
Yes, I can confirm that I see the same problem in aptitude. However, along with tmux it manifests itself significantly.
Comment 17 Jan Stolarek 2020-12-07 08:53:52 CST
Slávek, what are your steps to reproduce this in aptitude? I've never seen the problem happen in aptitude (with or without tmux), even though I use it frequently.
Comment 18 Michele Calgaro 2020-12-08 03:21:15 CST
Ok, so it seems we have two issues and not one. Maybe they are related, otherwise we will have to look into fixing both :-)
Comment 19 Jan Stolarek 2020-12-08 03:27:01 CST
I think the issue with unicode characters is a long-standing one, whereas tmux issue is a regression that happened when I upgraded from Debian 9 (stretch) to Debian 10 (Buster).
Comment 20 Slávek Banko 2020-12-08 03:38:00 CST
(In reply to Jan Stolarek from comment #17)
> Slávek, what are your steps to reproduce this in aptitude? I've never seen
> the problem happen in aptitude (with or without tmux), even though I use it
> frequently.

When using aptitude in interactive mode - there may be problems with scrolling, opening / closing sections.
Comment 21 Slávek Banko 2020-12-08 03:39:05 CST
(In reply to Michele Calgaro from comment #18)
> Ok, so it seems we have two issues and not one. Maybe they are related,
> otherwise we will have to look into fixing both :-)

I assume that these problems have the same cause.