How do I keep terminal line from overwriting itself?
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:
Edit: These are my prompt settings:
PS1='[e]0;u@h: wa]${debian_chroot:+($debian_chroot)}u@h:w33[1m`__git_ps1`33[0m$ '
TERM=xterm
.bashrc
:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[00m]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w33[1m`__git_ps1`33[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
command-line
add a comment |
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:
Edit: These are my prompt settings:
PS1='[e]0;u@h: wa]${debian_chroot:+($debian_chroot)}u@h:w33[1m`__git_ps1`33[0m$ '
TERM=xterm
.bashrc
:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[00m]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w33[1m`__git_ps1`33[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
command-line
Possible duplicate of How do I get long command lines to wrap to the next line?
– wjandrea
46 secs ago
add a comment |
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:
Edit: These are my prompt settings:
PS1='[e]0;u@h: wa]${debian_chroot:+($debian_chroot)}u@h:w33[1m`__git_ps1`33[0m$ '
TERM=xterm
.bashrc
:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[00m]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w33[1m`__git_ps1`33[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
command-line
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:
Edit: These are my prompt settings:
PS1='[e]0;u@h: wa]${debian_chroot:+($debian_chroot)}u@h:w33[1m`__git_ps1`33[0m$ '
TERM=xterm
.bashrc
:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[00m]$ '
else
PS1='${debian_chroot:+($debian_chroot)}u@h:w33[1m`__git_ps1`33[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
command-line
command-line
edited 8 mins ago
wjandrea
8,51142260
8,51142260
asked Aug 3 '12 at 21:07
thebaerthebaer
20529
20529
Possible duplicate of How do I get long command lines to wrap to the next line?
– wjandrea
46 secs ago
add a comment |
Possible duplicate of How do I get long command lines to wrap to the next line?
– wjandrea
46 secs ago
Possible duplicate of How do I get long command lines to wrap to the next line?
– wjandrea
46 secs ago
Possible duplicate of How do I get long command lines to wrap to the next line?
– wjandrea
46 secs ago
add a comment |
3 Answers
3
active
oldest
votes
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
It looks like this was already in my .bashrc file. Runningshopt
shows that checkwinsize is on.
– thebaer
Aug 4 '12 at 19:48
Hmm, what are the values of LINES and COLUMNS when the text is messed up?
– Julian Knight
Aug 7 '12 at 20:56
LINES is 24, COLUMNS is 80. Resizing the window does change these values, but the text is still messed up.
– thebaer
Aug 8 '12 at 15:39
Ah. OK, I suspect the setting for the PROMPT now. Can you post the values ofPS1
andTERM
. In fact, post the line defining PS1 in.bashrc
– Julian Knight
Aug 8 '12 at 20:41
I updated the question with these answers.
– thebaer
Aug 10 '12 at 15:43
|
show 3 more comments
I found the answer here. The answer with the most votes solved it for me.
To sum it up I had to wrap my formats in [ ]
export PS1='[33[1;32m]$(whoami)@$(hostname): [33[0;37m]$(pwd)$ [33[0m]'
add a comment |
For those using PuTTY terminal (v0.67) and terminal size is not updated correctly:
- You can right click on the window's left hand icon, then select Change Settings....
- Within PuTTY Reconfiguration, from left hand sidebar, click on Window > Set the size of the window > Columns.
- Update the Columns value manually. I changed mine to 255 and that stopped the terminal overwriting on its own line (when I type).
Note that Windows applications are technically off-topic here, but this is fine for the sake of people SSH-ing into Ubuntu installs.
– wjandrea
1 min ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f171694%2fhow-do-i-keep-terminal-line-from-overwriting-itself%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
It looks like this was already in my .bashrc file. Runningshopt
shows that checkwinsize is on.
– thebaer
Aug 4 '12 at 19:48
Hmm, what are the values of LINES and COLUMNS when the text is messed up?
– Julian Knight
Aug 7 '12 at 20:56
LINES is 24, COLUMNS is 80. Resizing the window does change these values, but the text is still messed up.
– thebaer
Aug 8 '12 at 15:39
Ah. OK, I suspect the setting for the PROMPT now. Can you post the values ofPS1
andTERM
. In fact, post the line defining PS1 in.bashrc
– Julian Knight
Aug 8 '12 at 20:41
I updated the question with these answers.
– thebaer
Aug 10 '12 at 15:43
|
show 3 more comments
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
It looks like this was already in my .bashrc file. Runningshopt
shows that checkwinsize is on.
– thebaer
Aug 4 '12 at 19:48
Hmm, what are the values of LINES and COLUMNS when the text is messed up?
– Julian Knight
Aug 7 '12 at 20:56
LINES is 24, COLUMNS is 80. Resizing the window does change these values, but the text is still messed up.
– thebaer
Aug 8 '12 at 15:39
Ah. OK, I suspect the setting for the PROMPT now. Can you post the values ofPS1
andTERM
. In fact, post the line defining PS1 in.bashrc
– Julian Knight
Aug 8 '12 at 20:41
I updated the question with these answers.
– thebaer
Aug 10 '12 at 15:43
|
show 3 more comments
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
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
answered Aug 3 '12 at 21:44
Julian KnightJulian Knight
1,4201018
1,4201018
It looks like this was already in my .bashrc file. Runningshopt
shows that checkwinsize is on.
– thebaer
Aug 4 '12 at 19:48
Hmm, what are the values of LINES and COLUMNS when the text is messed up?
– Julian Knight
Aug 7 '12 at 20:56
LINES is 24, COLUMNS is 80. Resizing the window does change these values, but the text is still messed up.
– thebaer
Aug 8 '12 at 15:39
Ah. OK, I suspect the setting for the PROMPT now. Can you post the values ofPS1
andTERM
. In fact, post the line defining PS1 in.bashrc
– Julian Knight
Aug 8 '12 at 20:41
I updated the question with these answers.
– thebaer
Aug 10 '12 at 15:43
|
show 3 more comments
It looks like this was already in my .bashrc file. Runningshopt
shows that checkwinsize is on.
– thebaer
Aug 4 '12 at 19:48
Hmm, what are the values of LINES and COLUMNS when the text is messed up?
– Julian Knight
Aug 7 '12 at 20:56
LINES is 24, COLUMNS is 80. Resizing the window does change these values, but the text is still messed up.
– thebaer
Aug 8 '12 at 15:39
Ah. OK, I suspect the setting for the PROMPT now. Can you post the values ofPS1
andTERM
. In fact, post the line defining PS1 in.bashrc
– Julian Knight
Aug 8 '12 at 20:41
I updated the question with these answers.
– thebaer
Aug 10 '12 at 15:43
It looks like this was already in my .bashrc file. Running
shopt
shows that checkwinsize is on.– thebaer
Aug 4 '12 at 19:48
It looks like this was already in my .bashrc file. Running
shopt
shows that checkwinsize is on.– thebaer
Aug 4 '12 at 19:48
Hmm, what are the values of LINES and COLUMNS when the text is messed up?
– Julian Knight
Aug 7 '12 at 20:56
Hmm, what are the values of LINES and COLUMNS when the text is messed up?
– Julian Knight
Aug 7 '12 at 20:56
LINES is 24, COLUMNS is 80. Resizing the window does change these values, but the text is still messed up.
– thebaer
Aug 8 '12 at 15:39
LINES is 24, COLUMNS is 80. Resizing the window does change these values, but the text is still messed up.
– thebaer
Aug 8 '12 at 15:39
Ah. OK, I suspect the setting for the PROMPT now. Can you post the values of
PS1
and TERM
. In fact, post the line defining PS1 in .bashrc
– Julian Knight
Aug 8 '12 at 20:41
Ah. OK, I suspect the setting for the PROMPT now. Can you post the values of
PS1
and TERM
. In fact, post the line defining PS1 in .bashrc
– Julian Knight
Aug 8 '12 at 20:41
I updated the question with these answers.
– thebaer
Aug 10 '12 at 15:43
I updated the question with these answers.
– thebaer
Aug 10 '12 at 15:43
|
show 3 more comments
I found the answer here. The answer with the most votes solved it for me.
To sum it up I had to wrap my formats in [ ]
export PS1='[33[1;32m]$(whoami)@$(hostname): [33[0;37m]$(pwd)$ [33[0m]'
add a comment |
I found the answer here. The answer with the most votes solved it for me.
To sum it up I had to wrap my formats in [ ]
export PS1='[33[1;32m]$(whoami)@$(hostname): [33[0;37m]$(pwd)$ [33[0m]'
add a comment |
I found the answer here. The answer with the most votes solved it for me.
To sum it up I had to wrap my formats in [ ]
export PS1='[33[1;32m]$(whoami)@$(hostname): [33[0;37m]$(pwd)$ [33[0m]'
I found the answer here. The answer with the most votes solved it for me.
To sum it up I had to wrap my formats in [ ]
export PS1='[33[1;32m]$(whoami)@$(hostname): [33[0;37m]$(pwd)$ [33[0m]'
edited Apr 13 '17 at 12:23
Community♦
1
1
answered Oct 9 '16 at 15:55
JerinawJerinaw
17619
17619
add a comment |
add a comment |
For those using PuTTY terminal (v0.67) and terminal size is not updated correctly:
- You can right click on the window's left hand icon, then select Change Settings....
- Within PuTTY Reconfiguration, from left hand sidebar, click on Window > Set the size of the window > Columns.
- Update the Columns value manually. I changed mine to 255 and that stopped the terminal overwriting on its own line (when I type).
Note that Windows applications are technically off-topic here, but this is fine for the sake of people SSH-ing into Ubuntu installs.
– wjandrea
1 min ago
add a comment |
For those using PuTTY terminal (v0.67) and terminal size is not updated correctly:
- You can right click on the window's left hand icon, then select Change Settings....
- Within PuTTY Reconfiguration, from left hand sidebar, click on Window > Set the size of the window > Columns.
- Update the Columns value manually. I changed mine to 255 and that stopped the terminal overwriting on its own line (when I type).
Note that Windows applications are technically off-topic here, but this is fine for the sake of people SSH-ing into Ubuntu installs.
– wjandrea
1 min ago
add a comment |
For those using PuTTY terminal (v0.67) and terminal size is not updated correctly:
- You can right click on the window's left hand icon, then select Change Settings....
- Within PuTTY Reconfiguration, from left hand sidebar, click on Window > Set the size of the window > Columns.
- Update the Columns value manually. I changed mine to 255 and that stopped the terminal overwriting on its own line (when I type).
For those using PuTTY terminal (v0.67) and terminal size is not updated correctly:
- You can right click on the window's left hand icon, then select Change Settings....
- Within PuTTY Reconfiguration, from left hand sidebar, click on Window > Set the size of the window > Columns.
- Update the Columns value manually. I changed mine to 255 and that stopped the terminal overwriting on its own line (when I type).
edited 2 mins ago
wjandrea
8,51142260
8,51142260
answered Dec 11 '18 at 6:39
Nasri NajibNasri Najib
1011
1011
Note that Windows applications are technically off-topic here, but this is fine for the sake of people SSH-ing into Ubuntu installs.
– wjandrea
1 min ago
add a comment |
Note that Windows applications are technically off-topic here, but this is fine for the sake of people SSH-ing into Ubuntu installs.
– wjandrea
1 min ago
Note that Windows applications are technically off-topic here, but this is fine for the sake of people SSH-ing into Ubuntu installs.
– wjandrea
1 min ago
Note that Windows applications are technically off-topic here, but this is fine for the sake of people SSH-ing into Ubuntu installs.
– wjandrea
1 min ago
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f171694%2fhow-do-i-keep-terminal-line-from-overwriting-itself%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Possible duplicate of How do I get long command lines to wrap to the next line?
– wjandrea
46 secs ago