Skip to content
  • Luis Javier Merino's avatar
    Fix regression preserving tcsh command prompt · 9dadb7b5
    Luis Javier Merino authored and Kurt Hindenburg's avatar Kurt Hindenburg committed
    Commit c3b3ef19 introduced a regression when invoking the
    clear-history-and-reset action.  While RIS (Reset to Initial State) is
    specified in DEC STD-070 as homing the cursor, konsole has grown some
    hacks in the name of usability to preserve the command prompt line.
    
    For a long time, it has sent two SIGWINCH with changed sizes after clear
    and reset actions to force the shell to redraw the prompt (see d346a2cc,
    temporarily disabled on 5d61b69e and re-added on 82778e87), which works
    for bash, zsh, ksh, ...
    
    tcsh doesn't redraw its prompt on SIGWINCH, but commit b8e96bcd modified
    Screen::refresh() so instead of clearing the entire screen and homing
    the cursor, it scrolled up everything but the last (usually the prompt)
    line.
    
    So, keep that last hack when called from clear-history-and-reset, and
    behave as specified on DEC STD-070 otherwise.
    
    Note that other ways of clearing the screen don't need hacks, e.g.
    Ctrl-L, if handled at all, is handled by the shell, which then redraws
    its prompt.  Calling "clear" or invoking "printf '\ec'" will result in
    the shell redrawing its prompt in the usual way.
    
    BUG: 453568
    9dadb7b5