Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: whoisterence on January 23, 2013, 06:41:09 AM
-
I am having trouble creating a PS1 prompt with complicated background and foreground colours.
But turns out if I set a really long PS1 like this one here, when I press ctrl+U to clear the prompt, the line above get erased?
PS1="12345678901234567890123456789012345678901234567890123456789012345678901234567890"
Is this because the terminal width is set to 80 somewhere?
I've tried different $TERM
rxvt, xterm-256color, etc..
same problem
-
Hi whoisterence
I'm not sure I understand your question, but Ctrl-u cuts everything to the left of the cursor back to the
command prompt. When you enter something and it hits the right edge of the terminal, it wraps around to the
next visible line, but is still considered to be part of the same line.
If that does not answer your question, you might want to give a more precise example of what you are doing.
-
It's kinda hard to explain because it is counter intuitive, here is the reproducing sequence, paste this in aterm:
PS1="12345678901234567890123456789012345678901234567890123456789012345678901234567890"
ls -al
echo This line will be erased when you press Ctrl+U
Now, type some garbage and ctrl+U, the last line gets erased.
Turns out this only happens in aterm, if I load bash.tcz and use bash this doesn't happens.
-
Slightly related question: Why on earth is your PS1 that long in the first place? That would get in the way of getting stuff done on any of the monitors I use...
-
Is this because the terminal width is set to 80 somewhere?
You could test that with something like:
aterm -g 160x24
-
@althalus
PS1 with path information can get quite long.
@tinypoodle
tested with wider aterm geometry e.g. 81x24 seems to fix it until I enlarge the terminal window, I think its because when I enlarge it, the text did not wrap around, but when I press Ctrl+U and it tries to calculate how many lines to remove. Since the text is over the aterm defined width, the terminal believes it should have wrapped and therefore decides to remove one more line.
I guess the geometry is suppose to follow whatever the terminal window is, but doesn't?
Since this is just a nuances I am not sure if it's worth the effort to look deeper. Especially since loading bash.tcz works as well.
-
I think it's a busybox's ash problem.
Maybe it doesn't recognize escape sequences and/or line length.
Please try the PS1 on bash if you want it.
Akane
-
I guess the geometry is suppose to follow whatever the terminal window is, but doesn't?
Not clear what you mean by this, but I am under the impression it sounds kind of the wrong way round...
-
@althalus
PS1 with path information can get quite long.
Ah, running bash under cygwin on windows does some odd things like that too with crazy long paths. I generally avoid it by just showing the basename part of the path.