Shell prompt not getting "translated"

I'm building OpenWRT from source for my Linkit Smart 7688 board. It turns out quite well, but my command prompt seems not being translated properly.

openwrt

The command prompt is kept as \u@\h:\w\ instead of replacing the them with their respective string. And login prompt failed to get the hostname too. (It's (none) in my case, as shown in the pic above.)
This is my build option for ash :

I've also enabled fgrep applet as it seems that /etc/profile requires it to work properly.

I'm not sure what I'm missing here, any advice is greatly appreciated :blush:

Can you paste here the PS1 line?

2 Likes

openwrt4

That's weird.... looks like $PS1 is empty :thinking:

grep PS1 /etc/profile ?

2 Likes

openwrt5
Here.

It's easier to paste the text rather than the screenshots.
The second export is not working properly. You are missing some opening square bracket and you are appending the whole user@host in the second line.

root@magiatiko:[/]#export PS1='\u@\h:\w\$ '
root@magiatiko:/# export PS1='\[\e\]0;\u@\h: \w\a\]'$PS1
;root@magiatiko: /]root@magiatiko:/# 

http://bashrcgenerator.com/

2 Likes

Post the diffconfig:
https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem#creating_diff_file

1 Like

Sorry for the screenshot :sweat_smile:
But hmmm actually I didn't make any change to /etc/profile, it came straight from github : https://github.com/openwrt/openwrt/blob/master/package/base-files/files/etc/profile

I'll try the bashrcgenerator you suggested, thanks a lot!

Yeah, I mistyped and it created a mistake. The actual lines in profile are correct. Did you add the PS1 anywhere else, like ~/.bashrc ?

No, I didn't do anything shell related apart from those in menuconfig.
I think I should try rebuild again with default configuration and see what changes I made affected the shell. :thinking:

@trendy @vgaetera
Big Thank You for all your replies, I think I found the problem!

The shell prompt did not work correctly because I disabled Fancy shell prompts under Base System > busybox > Settings

It's so easy to miss because it's not under shell configuration submenu, but now I've enabled it and problem solved :slight_smile:

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.