View previous topic :: View next topic |
Author |
Message |
r.j.hall n00b
Joined: 06 Feb 2003 Posts: 53 Location: London
|
Posted: Wed Jun 23, 2004 4:49 pm Post subject: long commands overwrite themselves |
|
|
why is it that sometimes in my konsole if I am typing a long command it doesn't linefeed correctly, instead it seems to start overwriting itself and moves the whole lot up one line also overwriting the previous line. If I try and go back in the command and edit it, even stranger things start happening.
Is this a common problem?
Is there an easy solution to prevent it?
Thanks
Rich _________________ --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
You've read it.
You can't unread it!
--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- |
|
Back to top |
|
|
Tyir Apprentice
Joined: 08 Mar 2004 Posts: 172 Location: Montreal
|
Posted: Wed Jun 23, 2004 5:05 pm Post subject: |
|
|
no idea how to prevent it, but i get it sometimes too! _________________ There are two things I have learnt in life:
1. Don't reveal everything you know. |
|
Back to top |
|
|
Useful Idiot Guru
Joined: 30 Aug 2002 Posts: 329 Location: Finland
|
Posted: Wed Jun 23, 2004 5:12 pm Post subject: |
|
|
Does this happen after you have resized konsole window? If it does add
Code: | shopt -s checkwinsize |
to your .bashrc. _________________ [size=9]We are all in the gutter, but some of us are looking at the stars. |
|
Back to top |
|
|
Zyne Guru
Joined: 08 Jun 2004 Posts: 334
|
Posted: Wed Jun 23, 2004 5:19 pm Post subject: |
|
|
lol... I'm getting this too from time to time... Really weird.
it happens mostly if it's the last line you're writing. The text above doesn't seem to move up anymore... :/
I'm gonna try Useful Idiot's solution, and see what that gives me.
btw this happens to me in aterm, and the only solution is to close aterm, and start a new console. |
|
Back to top |
|
|
sapphirecat Guru
Joined: 15 Jan 2003 Posts: 376
|
Posted: Wed Jun 23, 2004 8:19 pm Post subject: |
|
|
I've seen this happen in screen+xterm, especially with less, in which case a ^A ^L restores it. (I can't remember offhand if any resizing was involved, though...) If you're not using screen, hitting ^L from the shell prompt may help, although it will clear the screen as well. _________________ Former Gentoo user; switched to Kubuntu 7.04 when I got sick of waiting on gcc. Chance of thread necro if you reply now approaching 100%... |
|
Back to top |
|
|
Slack006 Tux's lil' helper
Joined: 10 Jan 2003 Posts: 97 Location: Desert of AZ
|
Posted: Sat Jun 26, 2004 7:12 pm Post subject: |
|
|
I had this same thing happen to me... Are you using color codes in your prompt? That was my issue.
I wish I could give you the exacts, but I am stuck at work and unable to get to my machine. The gist of it was I didn't properly escape my color codes. (Extra brackets needed, or a missing backslash or some such crap). Message me back if you don't get it figured out. To test, take the color codes out of your PS1 and see if the issue goes away. I'll post my shell color codes when I get home if you need them. _________________ Slack
May the SOURCE be with you... |
|
Back to top |
|
|
phranzee Guru
Joined: 22 Nov 2003 Posts: 397 Location: katowice/pl
|
Posted: Sat Jun 26, 2004 7:15 pm Post subject: |
|
|
every color declaration in your prompt should look like this:
\[COLOR\] - that's all _________________ signature fault
post dumped ;] |
|
Back to top |
|
|
Slack006 Tux's lil' helper
Joined: 10 Jan 2003 Posts: 97 Location: Desert of AZ
|
Posted: Sat Jun 26, 2004 7:18 pm Post subject: |
|
|
Exactly. That's where I was screwing up. Basically, if you don't properly escape the code, then the shell doesn't know exactly how long your prompt is (chars), and thus doesn't know when to wrap... _________________ Slack
May the SOURCE be with you... |
|
Back to top |
|
|
InfinityX Guru
Joined: 31 Jan 2004 Posts: 385
|
Posted: Sat Jun 26, 2004 8:36 pm Post subject: |
|
|
So is there something wrong with this one?
Code: | PS1="\[\033[0;31m\]\u@\[\033[0;31m\]\h \[\033[0;34m\]\W # \[\033[0m\]" |
I get the wrapping problem but it looks like I've closed them all |
|
Back to top |
|
|
Slack006 Tux's lil' helper
Joined: 10 Jan 2003 Posts: 97 Location: Desert of AZ
|
Posted: Sat Jun 26, 2004 8:43 pm Post subject: |
|
|
I don't see anything wrong with it... However, here's what I use in my .bashrc..
Code: |
# Color Variables
black='\[\e[0;30m\]'
BLACK='\[\e[1;30m\]'
red='\[\e[0;31m\]'
RED='\[\e[1;31m\]'
green='\[\e[0;32m\]'
GREEN='\[\e[1;32m\]'
yellow='\[\e[0;33m\]'
YELLOW='\[\e[1;33m\]'
blue='\[\e[0;34m\]'
BLUE='\[\e[1;34m\]'
magenta='\[\e[0;35m\]'
MAGENTA='\[\e[1;35m\]'
cyan='\[\e[0;36m\]'
CYAN='\[\e[1;36m\]'
white='\[\e[0;37m\]'
WHITE='\[\e[1;38m\]'
NC='\[\e[0m\]'
# Prompt Settings
PS1=$GREEN'\u@\h:[\w]\$'$NC' '
|
_________________ Slack
May the SOURCE be with you... |
|
Back to top |
|
|
gnuageux Veteran
Joined: 17 Apr 2004 Posts: 1201
|
Posted: Fri Jul 02, 2004 8:49 am Post subject: |
|
|
I like:
export PS1='\[\e[32m\]\u@\h \[\e[1;31m\]\w\[\e[1;34m\]\$\[\e[0m\] ' _________________ The realOTW: http://forums.realotw.org/index.php
Registered Linux user#364538 |
|
Back to top |
|
|
raid517 l33t
Joined: 06 Mar 2003 Posts: 946
|
Posted: Sun Aug 08, 2004 8:53 am Post subject: |
|
|
Erm... I don't get it. I'm a complete n00b with fixing bash. It always just worked before.
Can someone explain what it is I have to do? Do I have to edit some kind of configuration script for bash somewhere - and if so which one and how?
This is a deeply annoying problem, as bash is something I use pretty much all the time in Linux. It would be very tough to have to live without it.
GJ |
|
Back to top |
|
|
sf_alpha Tux's lil' helper
Joined: 19 Sep 2002 Posts: 136 Location: Bangkok, TH
|
Posted: Sun Aug 08, 2004 10:57 pm Post subject: |
|
|
It cause by curses based program terminate uncorrectly.
try
echo -n -e '\033c'
(Terminal Reset)
I think it not work all time but my Linux console. _________________ Gentoo Mirrors in Thailand (and AP)
http://gentoo.in.th |
|
Back to top |
|
|
raid517 l33t
Joined: 06 Mar 2003 Posts: 946
|
Posted: Sun Aug 08, 2004 11:32 pm Post subject: |
|
|
No it didn't work for me. I'm embarrased to say I don't even quite understand what these guys are talking about. I wish someone would explain it to me.
GJ |
|
Back to top |
|
|
raid517 l33t
Joined: 06 Mar 2003 Posts: 946
|
Posted: Tue Aug 10, 2004 12:02 pm Post subject: |
|
|
Bump... Guys please be nice and explain how to do this.
Thanks....
GJ |
|
Back to top |
|
|
conchyliferous n00b
Joined: 28 May 2005 Posts: 50 Location: Sweden
|
Posted: Thu Feb 23, 2006 8:03 am Post subject: What's wrong with bash? |
|
|
Got a problem with bash. It doesn't change line like it should. When the input fills up the terminal the first time and it should change line it doesn't. The input just starts to the left again and "eats up" that line. When it comes to the end of the terminal again it changes line like it should. |
|
Back to top |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Thu Feb 23, 2006 8:09 am Post subject: |
|
|
Is this in an xterm, or text console?
In xterm, Bash sometimes assumes wrong window sizes and breaks too early / too late (happens when you resize/maximize your window while Bash is not currently active). Resizing the window again while in bash prompt fixes this problem.
Also, Bash may get flakey when you print binary data to stdout... in that case, 'clear' and 'reset' may fix the problem.
Last edited by frostschutz on Thu Feb 23, 2006 8:10 am; edited 1 time in total |
|
Back to top |
|
|
beatryder Veteran
Joined: 08 Apr 2005 Posts: 1138
|
Posted: Thu Feb 23, 2006 8:09 am Post subject: |
|
|
can you post the out put of _________________ Dont make it idiot proof, make it work.
Neucode.org
<suppressed key> |
|
Back to top |
|
|
fangorn Veteran
Joined: 31 Jul 2004 Posts: 1886
|
Posted: Thu Feb 23, 2006 8:22 am Post subject: |
|
|
I know this behaviour from xterm. There exists a variable "XTerm*autoWrap: true" that does automatically use a new line at the end.
Edit:
should really answer directly, not after some minutes _________________ Video Encoding scripts collection | Project page |
|
Back to top |
|
|
conchyliferous n00b
Joined: 28 May 2005 Posts: 50 Location: Sweden
|
Posted: Mon Feb 27, 2006 8:15 am Post subject: |
|
|
Sorry for the late reply.
I'm using urxvt and I know that resizing can mess things up sometimes but it ain't that easy this time I'm afraid.
My PS1 follows here:
Code: | \e[32m\u \e[36m& \w\e[0m |
I tried out xterm with the autowrap option enabled. But that didn't help.
Thanks for helping me, appreciated. |
|
Back to top |
|
|
tomk Bodhisattva
Joined: 23 Sep 2003 Posts: 7221 Location: Sat in front of my computer
|
|
Back to top |
|
|
|