You are not logged in.
Pages: 1
I'm trying to configure my bash to wrap long command lines. I am looking for a behaviour similar to tcsh where, at the border of the window, the command is continued on the next line. In bash, the command continues at the begining of the same lines wich is messy. I tried using
set horizontal-scroll-mode on
in my ~/.inputrc but the continuation doesn't start at the windows border. I can post screenshots if that would help.
Thanks.
Offline
set it in your ~/.bashrc.
thats kinda funny, my default bash setup doesnt do that, nor does zsh.
Offline
yeah. post a screenie, and the contents of your .bash_profile and .bashrc..
and maybe your /etc/profile if you have altered it.
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
putting the line in .bashrc have no effect.
Here is my .bashrc
export EDITOR=emacs
export PAGER=less
export LESS="-f -r"
export BROWSER=firefox
PS1='[33[01;34m]#[33[00m] 33[01;31m]u@H[33[00m]33[01;39m] w $33[00m] '
# create an xauth key for root user
umask 377
/usr/X11R6/bin/xauth extract /tmp/user.xauth $DISPLAY
umask 022
#set horizontal-scroll-mode on
source ~/.aliases
my .bash_profile
. $HOME/.bashrc
my .inputrc
"e[A": history-search-backward
"e[B": history-search-forward
set show-all-if-ambiguous on
set page-completions off
set completion-query-items 10000
set horizontal-scroll-mode on
.
The screenshots:
With tsch (what I'm looking for)
With set horizontal-scroll-mode off:
If I continue to press the 'a' key, it overwrite the whole line and wraps at the window border.
With set horizontal-scroll-mode on:
It wraps 2 inches before reaching the window border.
[/img]
Offline
umm. you might try turning off horizontal scroll mode in your .inputrc
in fact, I would say remove all your . config files (back them up somewhere) and try starting from scratch. Maybe just create a new user instead...
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
The problem is caused by the PS1 line. I will try narrow it further.
Offline
I solved it. There was some missing [ in my PS1 variable.The correct one is :
PS1='[33[01;34m]#[33[00m] [33[01;31m]u@H[33[00m][33[01;39m] W $[33[00m] '
Thanks everyone!
Offline
glad you got it fixed.
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
Pages: 1