You are not logged in.

#1 2008-12-27 20:41:41

HyperBaton
Member
From: Belgium
Registered: 2008-01-18
Posts: 207

[solved] CLI input does not skip to next line

I have an odd problem with my CLI input. If I need to type a long command, the screen is obviously not big enough. But instead of skipping to the next line, it overwrites the line I was writing in. Annoying, to say the least. The weird part is, if I continue typing then till the end of the screen, then it does skip to a next line. But never the first time around. Has anyone else experienced this? I'm hoping someone can help me, this is so frustrating.

Last edited by HyperBaton (2008-12-28 19:12:54)

Offline

#2 2008-12-27 20:44:31

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: [solved] CLI input does not skip to next line

Err what term you using? you may have a problem with your prompt.....

Last edited by Mr Green (2008-12-27 20:46:05)


Mr Green

Offline

#3 2008-12-27 20:57:43

HyperBaton
Member
From: Belgium
Registered: 2008-01-18
Posts: 207

Re: [solved] CLI input does not skip to next line

Damn, I'm a pretty experienced linux user, but not when it comes to this type of stuff. What exactly do you mean by term? You mean bash? If so, that's what I'm using.

Offline

#4 2008-12-27 22:38:07

heleos
Member
From: Maine, USA
Registered: 2007-04-24
Posts: 678

Re: [solved] CLI input does not skip to next line

which shell would be helpful too, but he's refering to the terminal emulator you're using (xterm, urxvt, konsole, gnome-terminal, terminal, etc)

Offline

#5 2008-12-27 22:39:32

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: [solved] CLI input does not skip to next line

Or does it happen on a tty ?


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#6 2008-12-27 22:41:46

HyperBaton
Member
From: Belgium
Registered: 2008-01-18
Posts: 207

Re: [solved] CLI input does not skip to next line

Ah, I'm working in the 'real deal' at the moment heh. This is a headless server that I usually access via PuTTy, but I had to do a lot of maintenance so I put in a videocard and hooked up a monitor. So I'm just working in a plain old 640x480 full screen terminal. A virtual console is what it's called I suppose?

Offline

#7 2008-12-27 22:43:28

HyperBaton
Member
From: Belgium
Registered: 2008-01-18
Posts: 207

Re: [solved] CLI input does not skip to next line

moljac024 wrote:

Or does it happen on a tty ?

Yes, that's it I think smile

By the way, I have had this problem as well when being logged in via SSH (PuTTy), but I did not expect to have this problem in a tty.

Offline

#8 2008-12-28 09:28:27

string
Member
Registered: 2008-11-03
Posts: 286

Re: [solved] CLI input does not skip to next line

I think I remember seeing a bunch of people having this problem because of a messed up PS1. Did you play with it?

Edit: I meant: with PS1

Last edited by string (2008-12-28 09:28:49)

Offline

#9 2008-12-28 09:58:54

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: [solved] CLI input does not skip to next line

So did you play with your, er, PS1 ?


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#10 2008-12-28 10:09:36

string
Member
Registered: 2008-11-03
Posts: 286

Re: [solved] CLI input does not skip to next line

moljac024: You're like one of my favorite mythological creatures on this forum -- and I has a secret (I'm still pondering on whether to reveal it to you or nots) -- ok. check your email, kthnx.

Last edited by string (2008-12-28 10:11:32)

Offline

#11 2008-12-28 13:15:35

HyperBaton
Member
From: Belgium
Registered: 2008-01-18
Posts: 207

Re: [solved] CLI input does not skip to next line

moljac024 wrote:

So did you play with your, er, PS1 ?

I think I did yes, I'll post it here.

PS1='\h:\W \e[0;31m\$\e[m '

It's been a while since I made that prompt, don't really know much about it anymore.

Offline

#12 2008-12-28 13:36:30

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: [solved] CLI input does not skip to next line

I can say that colour codes (i.e. "\e[0;31m\") play a big role in making your prompt line shorter... That's one of the reasons why I switched to zsh: now I can customise my prompt and type very long lines with no problem at the same time.


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#13 2008-12-28 14:15:02

string
Member
Registered: 2008-11-03
Posts: 286

Re: [solved] CLI input does not skip to next line

Indeed, change your PS1 to this:

PS1="\h:\W \[\e[0;31m\]\$\[\e[0m\] "

Personally I don't use colors in my PS1 (in fact I have USECOLOR="no" in /etc/rc.conf, amongst other things). I like my PS1 simple and sweet. It used to be just "\w > " for regular users (and "\w # " for root) but since having multiple SSH sessions and not being able to tell right away what commands I'm giving to which host .. I changed stuff to: "\u@\h:\w$ ".

Last edited by string (2008-12-28 14:17:27)

Offline

#14 2008-12-28 17:17:00

HyperBaton
Member
From: Belgium
Registered: 2008-01-18
Posts: 207

Re: [solved] CLI input does not skip to next line

Changing it to "\u@\h:\w$ " seems to have done the trick yes! Thanks. But I still don't really know why to be honest. Bash doesn't like colors?

Offline

#15 2008-12-28 18:39:17

string
Member
Registered: 2008-11-03
Posts: 286

Re: [solved] CLI input does not skip to next line

You see, if you read my previous post carefully, I gave you some advice on changing your PS1 to "\h:\W \[\e[0;31m\]\$\[\e[0m\] ". This will look exactly like your previous prompt (coloury and what not) yet not have the skippy problem. Bash loves colours, it simply hates badly crafted PS1 variables (which is what you had .. and which is what I provided the correct version of).

Offline

#16 2008-12-28 18:53:48

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: [solved] CLI input does not skip to next line

Ah thanks string, I didn't know you could do that. I just assumed that bash didn't like colours...


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#17 2008-12-28 19:12:32

HyperBaton
Member
From: Belgium
Registered: 2008-01-18
Posts: 207

Re: [solved] CLI input does not skip to next line

Yes, that works as well! Sweet. I copied it wrong the first time so it didn't quite work (which is why I just grabbed the other PS1 you posted), but I've copied it correctly now and it works indeed. Very helpful topic, should save some other people the trouble I hope.

Offline

#18 2008-12-28 19:27:52

string
Member
Registered: 2008-11-03
Posts: 286

Re: [solved] CLI input does not skip to next line

Offline

#19 2008-12-28 19:29:43

HyperBaton
Member
From: Belgium
Registered: 2008-01-18
Posts: 207

Re: [solved] CLI input does not skip to next line

Searched but did not find I'm afraid :S

But it appears you are the jedi master of PS1 though smile

Offline

Board footer

Powered by FluxBB