Bug 162515

Summary: Text appear misplaced in Terminal tool
Product: [Applications] kate Reporter: Syam <get.sonic>
Component: applicationAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: adaptee, andresbajotierra, cullmann, drankinatty, gabrielperren, kwrite-bugs-null, spamfuckers, valir
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Screenshot showing the problem
kate-bug-1.jpg

Description Syam 2008-05-23 12:00:49 UTC
Version:           3.0.3 (using KDE 4.0.3)
Installed from:    Fedora RPMs
OS:                Linux

After opening a couple of files with Kate, I open the attached terminal tool.
The terminal is supposed to cd to the directory of the file. But the text is misplaced between lines. A 'clear' cleans everything up, but the issue is better resolved. :-)
Attached is a screenshot.
Comment 1 Syam 2008-05-23 12:01:36 UTC
Created attachment 24911 [details]
Screenshot showing the problem
Comment 2 Brian Vuyk 2008-05-23 15:50:31 UTC
Using the same version under Kubuntu/KDE4, I get similar errors with the terminal tool. I will attach a screenshot as well. Bug should be confirmed...
Comment 3 Brian Vuyk 2008-05-23 15:51:18 UTC
Created attachment 24915 [details]
kate-bug-1.jpg
Comment 4 Syam 2008-05-24 05:00:16 UTC
Problem exists in Kate 3.0.4/KDE 4.0.4
Comment 5 Syam 2008-06-28 05:48:34 UTC
Dolphin also *had* the same problem with the Terminal panel. But it now seems to be *fixed*, by automatically doing a clear immediately after it's invoked.
Perhaps Kate can do the same.
Comment 6 Anders Lund 2008-06-29 09:46:14 UTC
On the other hand, that will remove the text. It would be better if it could 
be solved at the konsolepart side if we cant find a proper solution. I do not 
know what happens when toolviews are hidden, but I guess the problem comes 
from the collapsing setting the height to 0.
Comment 7 Dario Andres 2008-07-31 00:25:56 UTC
Version 3.1.0 Using KDE 4.1.00 (KDE 4.1.0) (KDEmod) in ArchLinux i686
I can reproduce this bug
Comment 8 Dominik Haumann 2008-10-31 12:30:12 UTC
*** Bug 173867 has been marked as a duplicate of this bug. ***
Comment 9 David Rankin 2008-11-04 17:09:08 UTC
Kate Devs,

    I wanted to make sure you got the information from my duplicate bug (173867) "Summary: kate terminal show/hide truncates scrollback" for your consideration here. This was on openSuSE 11.0 x86_64 (kate 2.5.9 on kde 3.5.9 "release 49.1") Sorry I missed this bug when I filed the first time. 

    In kate after using the terminal window and then hiding the terminal window, when your show the terminal window again, the scrollback is truncated at 18 characters. Here are two screenshots that clearly illustrate the problem.

http://www.3111skyline.com/download/screenshots/kde/kate_terminal-scrollback.jpg

http://www.3111skyline.com/download/screenshots/kde/kate_terminal-scrollback1.jpg

    In the first, I have opened the terminal window and created a screen width ruler showing the characters that are viewable in the terminal window. Then I close terminal to make a quick edit.

    As shown in the second screenshot, when I show the terminal again, all the existing text in the terminal window has been truncated to 18 characters. Bummer.

    That's the bug. Let me know if I can send you anything else or test it in other ways. Thanks.
Comment 10 Dominik Haumann 2008-11-05 15:18:43 UTC
The code in Kate is only hiding and showing the Konsole Part. This is probably a bug in the konsole part and not in kate. Adding konsole authors.

Research shows in kdebase/apps/konsole/src/TerminalDisplay.cpp:
1. TerminalDisplay::hideEvent: sizes are ok (231 x 791)
2. TerminalDisplay::showEvent: sizes are wrong (61 x 44)
It should still be 231 x 791 in (2).

We can see showEvent() already has wrong _contentHeight/Width. Where does it come from? _contentHeight/Width is calculated in TerminalDisplay::calcGeometry() depending on the contentsRect(). So the contentsRect() must be wrong. Debugging shows:
1. ::calcGeometry() is called before showEvent() with contentsRect() returning e.g. QRect(0,0 62x62) <-- This is wrong.
2. now showEvent is called, again with wrong _contentHeigth/Width
3. ::calcGeometry() is called again, this time with correct contentsRect(), e.g. set to QRect(0,0 809x232)

This really looks like a konsole issue.
Comment 11 Pawel Pabian 2009-04-06 23:14:42 UTC
Confirmed. This is VERY annoying bug. For example i often start long tests on Kate terminal, close it and go back to coding. If i open terminal after test ends the summary output is messed up (just like on screnshots uploaded here by other reporters).

Confirmed on KDE versions 3.5.7-4.2.2.
Comment 12 Dominik Haumann 2009-04-07 11:30:53 UTC
Reassign to Konsole developers, see comment 10.
Comment 13 Dominik Haumann 2010-06-21 00:49:40 UTC
Any news? See comment #10 for a start. Would be nice if this gets resolved...
Comment 14 Valentin Rusu 2011-02-20 12:38:13 UTC
Hello,
This won't reproduce when testing this on KDE 4.6 RC2.
Please update packages and confirme it's fixed for you.
Valentin
Comment 15 Syam 2011-02-20 16:46:51 UTC
(In reply to comment #14)

The problem *exists* on KDE 4.6 too.
I've updated to KDE 4.6 from kde-testing repo for Fedora 14. Yes, 4.6 is not yet available on stable Fedora updates repo yet. But as far as I can see from these builds, the bug is open.
Comment 16 Syam 2011-02-20 16:50:36 UTC
(In reply to comment #14)

The problem *exists* on KDE 4.6 too.
I've updated to KDE 4.6 from kde-testing repo for Fedora 14. Yes, 4.6 is not
yet available on stable Fedora updates repo yet. But as far as I can see from
these builds, the bug is open.
Comment 17 Dominik Haumann 2011-08-02 19:54:04 UTC
Maybe bug #132197 is a duplicate. Does it work with KDE 4.7?
Comment 18 Valentin Rusu 2011-08-02 22:53:09 UTC
The bug is still there under current git master version.

I looked/stepped into the code and now can say that the resizing bug shows only when konsole is used as a KPart. Maybe something is missing inside Part.cpp compared to full konsole session. I cannot figure it out for the moment.
Comment 19 Jekyll Wu 2011-10-24 08:10:01 UTC
I haven't looked into the details mentioned in comment #10, but I failed to reproduce the problem in the original report and comment #9 with kate-3.7.2 and kate-2.7.999(devel version).
Comment 20 Dominik Haumann 2011-10-24 19:40:07 UTC
It's still there, with Kate and Konsole from git.
Comment 21 Dominik Haumann 2011-10-26 16:45:19 UTC
The resize event with QSize(80, 80) comes from katemdi.cpp, so this is not a Konsole issue after all... Still need to find out the reason.
Comment 22 Christoph Cullmann 2011-10-26 20:35:33 UTC
Party fixed in GIT master, still cornercases wrong I think :(
Comment 23 Dominik Haumann 2011-12-10 13:11:21 UTC
*** Bug 287538 has been marked as a duplicate of this bug. ***
Comment 24 Christoph Cullmann 2012-11-10 19:43:34 UTC
Git commit 71d40cc8b9f18983d59a27f63f2859dd27392dd2 by Christoph Cullmann.
Committed on 10/11/2012 at 20:41.
Pushed by cullmann into branch 'master'.

fix problem with artificial konsole resizing that kills the content of konsole window

M  +8    -0    kate/app/katemdi.cpp

http://commits.kde.org/kate/71d40cc8b9f18983d59a27f63f2859dd27392dd2