Bug 153264

Summary: In "konsole" under Edit -> Clear Terminal, it clears the whole thing off including "ubuntu@ubuntu:~$" while this is not supposed to happen
Product: [Applications] konsole Reporter: Ramanathan <wwp06>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED NOT A BUG    
Severity: normal    
Priority: NOR    
Version: 1.6.6   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Ramanathan 2007-12-02 08:06:18 UTC
Version:           1.6.6 (using KDE 3.5.6, Kubuntu (feisty) 4:3.5.6-0ubuntu14)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.20-15-generic

Normally if we type "clear" it clears the screen and prints "ubuntu@ubuntu:~$ ". But if we do the same using the Edit -> Clear Terminal, everything disappears but the cursor goes to its original position.
Comment 1 Robert Knight 2007-12-02 14:49:36 UTC
This behaviour is correct, if not desirable.  "Edit -> Clear Terminal" is intended to clear the text of the screen and nothing else - the state of the terminal is otherwise unchanged.   The closest equivalent to the "clear" command is "Edit -> Reset & Clear Terminal".  'Edit -> Reset & Clear Terminal' erases everything on screen and moves the cursor back to the top-left corner.  Unlike typing 'clear' it will also remove the prompt (the "ubuntu@ubuntu:~$ " text) - this is because the 'clear' command is part of the shell which knows about the prompt and can therefore avoid clearing it in the first place or clear the whole screen and then re-print the prompt.  Konsole doesn't know anything about the prompt so all it can do is clear the entire screen and reset the terminal back to its original state.

In KDE 4 a slightly unpleasant trick is used where the terminal is resized slightly larger and then back to its original size during a reset (Edit -> Clear & Reset) which causes some shells (eg. bash) to reprint their prompt - so the effect is similar to typing "clear".  I won't be backporting this to KDE 3 however.