Bug 153264 - In "konsole" under Edit -> Clear Terminal, it clears the whole thing off including "ubuntu@ubuntu:~$" while this is not supposed to happen
Summary: In "konsole" under Edit -> Clear Terminal, it clears the whole thing off incl...
Status: RESOLVED NOT A BUG
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 1.6.6
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-02 08:06 UTC by Ramanathan
Modified: 2007-12-02 14:49 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.