Bug 214196

Summary: [REGRESSION] konsole: scrollbar not updated when history cleared
Product: [Applications] konsole Reporter: esigra
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED WORKSFORME    
Severity: normal CC: esigra, kristoffer.grundstrom1983, lueck, robertknight
Priority: NOR    
Version: 2.3   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description esigra 2009-11-12 00:02:11 UTC
Version:           2.3 (using KDE 4.3.1)
OS:                Linux
Installed from:    Gentoo Packages

1. Start Konsole.
2. Set history size to some number of lines that is higher than the number of lines that fit in the window.
3. Produce so many lines of that they do not all fit in the window. Now the scrollbar knob does not have maximum size. This indicates that it is possible to scroll back.
4. Clear the history.

The scrollbar knob is unchanged.

Expected behavior: the scrollbar knob is changed to its maximum size, to indicate that it is not possible to scroll back. This worked in KDE3, so it is a regression.

5. Try to scroll with the scrollbar or mousewheel. Now the scrollbar knob is finally updated.
Comment 1 Burkhard Lück 2010-01-06 22:29:50 UTC
(In reply to comment #0)
> 4. Clear the history.
> 
How do you clear the history?
Edit-> Clear & Reset -> scrollbar not updated 
or
Scrollback->Clear Scrollback & Reset (Ctrl+Shift+X) ->scrollbar is updated
Comment 2 esigra 2010-01-06 22:54:55 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > 4. Clear the history.
> > 
> How do you clear the history?
> Edit-> Clear & Reset -> scrollbar not updated 
> or
> Scrollback->Clear Scrollback & Reset (Ctrl+Shift+X) ->scrollbar is updated

No, Scrollback->Clear Scrollback (Ctrl+Alt+H)
Comment 3 Burkhard Lück 2010-01-06 23:12:36 UTC
With konsole 2.3.3 (kde 4.3.3) compiled from sources I have Scrollback->Clear Scrollback, but no default shortcut Ctrl+Alt+H for this action.
Using this option the scrollbar knob is indeed unchanged.

Konsole 2.4 in recent trunk compiled from sources does not have this option Scrollback->Clear Scrollback anymore, only the options I described in Comment #1, so I do not see a regression.
Comment 4 Kurt Hindenburg 2010-01-07 05:17:30 UTC
These 2 were removed from KDE 4.4.

Edit->Clear Display
Scrollback->Clear Scrollback

They were removed as it was deemed they made no sense w/o the 'reset' part.
Comment 5 Matthew Woehlke 2010-01-08 02:46:41 UTC
> Edit->Clear Display
> Scrollback->Clear Scrollback
> 
> They were removed as it was deemed they made no sense w/o the 'reset' part.

Huh? That's marginal for 'clear display', and just plain dumb for 'clear scrollback'. The latter (which should have the same effect as '\e[3J', i.e. toss out everything not on the screen) is extremely useful if you've, say, done a build, ran 'clear', ran some other stuff, and now want to throw out the scrollback of the build but need the other stuff still. Or even if you've just run 'clear' and want to clear the scrollback also, but don't want your bash prompt to disappear.

Actually I tend to think going behind the back of the running application and clearing/resetting the screen is questionable.

I hope this will be reverted. (And I'm glad '\e[3J' still works; I am going to be REALLY annoyed if that goes away :-). Which is to say, the code is still there, there is just not a menu item for it any more.)

As for the original bug, I seem to recall this happening in early KDE4, but it has been working correctly for quite some time. Works for me in trunk, anyway (I am using "echo -e '\e[3J'" for step 4.)
Comment 6 Robert Knight 2010-01-08 11:04:06 UTC
> Scrollback->Clear Scrollback
> They were removed as it was deemed they made no sense w/o the 'reset' part

Remind me, was there a discussion about this somewhere?

> Or even if you've just run 'clear' and want to clear the
> scrollback also, but don't want your bash prompt to disappear.

That case is handled by Clear and Reset (Ctrl+Shift+X) - Konsole jiggles the terminal window size to make the shell redraw the prompt (works with bash, not with some other shells).
Comment 7 Kurt Hindenburg 2010-01-09 20:19:54 UTC
Only the GUI menus were removed.

Clear Display just cleared the display and left the cursor were it was - which makes no sense

Clear Scrollback cleared scrollback but not display - it was thought most people would want the Reset.

It was displayed some time ago; due to Strings issue, 4.4 was the earliest it was committed.
Comment 8 Christoph Feck 2010-09-30 06:18:12 UTC
This works fine in trunk, at least with the "Clear Scrollback" from Context menu.
Comment 9 Kurt Hindenburg 2011-02-28 01:14:01 UTC
This was fixed sometime in the past.
Comment 10 Kristoffer Grundström 2018-02-18 23:47:41 UTC
I feel that this needs to be reopened as I can't make reset OR clear to update the scrollbar.

OK to reopen?
Comment 11 Kristoffer Grundström 2018-02-18 23:49:40 UTC
(In reply to Kristoffer Grundström from comment #10)
> I feel that this needs to be reopened as I can't make reset OR clear to
> update the scrollbar.
> 
> OK to reopen?

I have to add that I use Mageia 6 and the latest Konsole version (17.12.2) that I even built from the Cauldron src.rpm.
Comment 12 Kristoffer Grundström 2018-02-18 23:51:35 UTC
Not sure that this is the right bugreport to type in, but I have the same problem, that if I type reset or clear the scrollbar doesn't update even though the output looks to be cleared.
Comment 13 Kurt Hindenburg 2018-02-19 02:57:33 UTC
I would notice if this didn't work as I use it daily.  What shell are you using?  You're not using something like tmux/screen/etc?