You are not logged in.

#1 2005-07-08 23:44:32

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

bash: wrapping long command line [SOLVED]

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

#2 2005-07-09 01:49:21

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: bash: wrapping long command line [SOLVED]

set it in your ~/.bashrc.

thats kinda funny, my default bash setup doesnt do that, nor does zsh.

Offline

#3 2005-07-09 02:27:07

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: bash: wrapping long command line [SOLVED]

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

#4 2005-07-09 04:48:58

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: bash: wrapping long command line [SOLVED]

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)
tcsh.gif
With set horizontal-scroll-mode off:
bashoff1.gif
If I continue to press the 'a' key, it overwrite the whole line and wraps at the window border.
bashoff2.gif
With set horizontal-scroll-mode on:
It wraps 2 inches before reaching the window border.
bashon1.gif
bashon2.gif

[/img]

Offline

#5 2005-07-09 06:28:29

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: bash: wrapping long command line [SOLVED]

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

#6 2005-07-09 06:44:11

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: bash: wrapping long command line [SOLVED]

The problem is caused by the PS1 line. I will try narrow it further.

Offline

#7 2005-07-09 07:03:37

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: bash: wrapping long command line [SOLVED]

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! big_smile

Offline

#8 2005-07-09 07:10:05

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: bash: wrapping long command line [SOLVED]

glad you got it fixed. big_smile


"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

Board footer

Powered by FluxBB