rxvt prompt is 'broken' in 1.0.5 (Solved)

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
ozboomer
Posts: 135
Joined: Wed 04 May 2005, 21:22
Location: Melbourne, Australia

rxvt prompt is 'broken' in 1.0.5 (Solved)

#1 Post by ozboomer »

Since I've upgraded to 1.0.5, I've found the prompt in my rxvt sessions is not as I expect it to look.

I include the node name in the PS1 variable in /root/.rxvtrc (and export it there) and I have an entry in /etc/profile:

Code: Select all

export ENV=/root/.rxvtrc
..which worked from v0.9.7 or so up until 1.0.5. When I open an rxvt session under X, I only get the normal '#' prompt, whereas if I exit X and get to a 'console' prompt, the prompt is as I expect it to appear.

What seems to be happening is that under X, I seem to be running bash rather than (Busybox's) sh. If I type 'blah' at a prompt in an rxvt session under X, a message is displayed: 'bash: blah: command not found' Whereas if I try that at the 'console' prompt, I see the message: 'blah: no such file or directory'.

In the rxvt session under X, if I try typing: /bin/sh /usr/local/bin/rxvt I get the message: '/usr/local/bin/rxvt: 1: Syntax error: "(" unexpected'.

Is there some way that I can get my prompt working again under X?

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#2 Post by GuestToo »

1.0.5 has SHELL="/bin/bash" in /etc/profile

you can change that to SHELL=/bin/sh or SHELL=/bin/ash

ash is busybox's shell
sh is bash running under the name sh
bash is bash running under the name bash

ash and sh will execute the file named in ENV everytime they start ... you can setup environment variables there, and aliases, and set the prompt

bash does not use ENV ... it executes /root/.bashrc ... you can setup the environment for bash in there, including the prompt

ash and sh use /etc/profile if they are started as a login shell ... bash uses /root/.bash_profile (or maybe it's .bash-profile) if it's started as a login shell

also, bash and ash have a slightly different syntax for setting the prompt

you can see what's happening if you put echo commands in the rc files, something like echo '/root/.bashrc is executing'

you can change SHELL=/bin/bash in /etc/profile to SHELL=/bin/sh or to SHELL=/bin/ash ... or you can setup ENV and .bashrc files to work the way you want

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#3 Post by rarsa »

Here is a good tutorial for that http://www.freebsddiary.org/prompt.php

User avatar
ozboomer
Posts: 135
Joined: Wed 04 May 2005, 21:22
Location: Melbourne, Australia

#4 Post by ozboomer »

Many thanks for the pointers... I've made some notes and have made some suitable changes to /etc/profile and ~/.bashrc

Post Reply