0

In vagrant ssh, using bash shell, using the 'clear' command results in cleared screen then with two prompts on the top line, where only one is expected or wanted. Operationally it does not matter, just visually annoying. What/where controls this behavior?

[vagrant@aws-terraform ~]$ [vagrant@aws-terraform ~]$

PS1 is [\u@\h \W]\$
SHELL is /bin/bash
Operating System: AlmaLinux 8.5 (Arctic Sphynx)
Kernel: Linux 4.18.0-348.20.1.el8_5.x86_64

Edit per request:

[vagrant@aws-terraform ~]$ type -a clear
clear is /usr/bin/clear

[vagrant@aws-terraform ~]$ echo "$PROMPT_COMMAND"
printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"

'reset' command does not have the same quirk. It results in a single prompt.
Robert Kerr
  • 101
  • 3
  • 1
    https://unix.stackexchange.com/q/541909/117549 from the "Related" sounds interesting; do you have anything configured in PROMPT_COMMAND? (`echo "$PROMPT_COMMAND"`) – Jeff Schaller Apr 01 '22 at 15:40
  • clear -V reports an older version (ncurses 6.1.20180224) of ncurses, if that's where you were going with prior question. Looks like v6.3 is the current stable. – Robert Kerr Apr 01 '22 at 15:45
  • I was just curious if you had a `clear` function/alias/etc that was overriding the default behavior, so the `type -a` output clears that part up. Thank you! – Jeff Schaller Apr 01 '22 at 16:04

0 Answers0