|
#1
| |||
| |||
| Line wrapping in terminal One thing that bugs me all the time which I haven't been able to figure out is buggy line wrapping in console windows such as Terminal. This is not a Terminal-specific issue, it happens pretty much all over, including XTerm. When I type in a long line, instead of wrapping over to the next line, the text wraps back to the front of the current line overwriting it so that I don't know what the hell I've typed. Does anyone know how to fix this? It bugs me to no end! Thanks. |
|
#2
| ||||
| ||||
| Doesn't do that to me. What shell are you using (I'm using tcsh) ?
__________________ michaelsanford.com Blog Twitter Tumblr LinkedIn iMac Aluminum 24" | MacOS X 10.5-current | 3.06 GHz Intel Core Duo | 4 GB RAM | 1 TB HDD iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2120 GB RAID 1, 2500 GB RAID 0 |
|
#3
| ||||
| ||||
| I found it did that if I used certain escape sequences - if I made my prompt bold, in particular, it alwayst happened. I changed my prompt to leave out the bold part, and it worked ok for the most part. Another thing I find is that after running some commands that use up the whole screen (curses/ncurses based?), and occasionally just after commands with a lot of output, the next command line will start being entered several lines too high, over top of previously typed commands.
__________________ What is the robbing of a bank compared to the founding of a bank? -- Bertold Brecht |
|
#4
| ||||
| ||||
| Argh, I'm now noticing this problem as well. I took off the bold portion of my prompt, and I still get wrap around, currentky, here's my current .bash_profile: Code: GREEN="\e[0;32m"
BLUE="\e[0;34m"
PLAIN="\e[m"
PS1="${GREEN}\u@\h ${BLUE}\W $ ${PLAIN}"
alias ls='ls -GF'
alias su='su -l'
PATH=$PATH:/usr/local/bin
__________________ OS 10.4.10 PowerBook: G4 1.5Ghz 80Gb 1.5GB Ram Ati-9700 (128Ram) Superdrive ![]() iPod Video 5th gen, black 30GB ![]() AirPort Express with AirTunes |
|
#5
| ||||
| ||||
| Fixed! Okay, did some more research on the whole ANSI escape sequences and here's what I found: UnixGuide Quote:
Code: GREEN="\[\e[0;32m\]"
BLUE="\[\e[0;34m\]"
PLAIN="\[\e[m\]"
PS1="${GREEN}\u@\h ${BLUE}\W $ ${PLAIN}"
alias ls='ls -GF'
alias su='su -l'
PATH=$PATH:/usr/local/bin
__________________ OS 10.4.10 PowerBook: G4 1.5Ghz 80Gb 1.5GB Ram Ati-9700 (128Ram) Superdrive ![]() iPod Video 5th gen, black 30GB ![]() AirPort Express with AirTunes |
|
#6
| ||||
| ||||
| Excellent! Thanks for the tip. I was using stuff like `tput bold` and `tput sgr0` (for plain text) for escape sequences and having the same sort of problems. Just tried with the backticked stuff like this: bold='\['`tput bold`'\]' and line wrapping works fine again! Anyway I just use tcsh, which is what I got used to from OS X pre-10.3 anyway. Using the predefined sequences %B and %b for bold on/off, it counts printing characters correctly on its own.
__________________ What is the robbing of a bank compared to the founding of a bank? -- Bertold Brecht |
![]() |
| Thread Tools | |
|
|