Monday, May 6, 2024
16
rated 0 times [  16] [ 0]  / answers: 1 / hits: 27584  / 2 Years ago, fri, december 24, 2021, 10:00:20

In a terminal window any smaller than fullscreen, if I type in a long command it starts overwriting the current line I'm on. If I type an additional line's worth, it finally moves to the next line. Does anyone know how to fix this?



This is what happens visually:



terminal screenshot



Edit: These are my prompt settings:



PS1='[e]0;u@h: wa]${debian_chroot:+($debian_chroot)}u@h:w033[1m`__git_ps1`033[0m$ '
TERM=xterm


.bashrc:



if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}[033[01;32m]u@h[033[00m]:[033[01;34m]w[033[00m]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w033[1m`__git_ps1`033[0m$ '
fi

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="[e]0;${debian_chroot:+($debian_chroot)}u@h: wa]$PS1"
;;
*)
;;
esac

More From » command-line

 Answers
5

For some reason the terminal size is mis-reporting. It should change when you resize the terminal.



Try this in your .bashrc command file:



# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

[#36387] Saturday, December 25, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
fittecanap

Total Points: 322
Total Questions: 100
Total Answers: 105

Location: Israel
Member since Tue, Nov 17, 2020
4 Years ago
;