How to customize ps1

maybe a colorful ps1 :slight_smile:

You want a colourful cli on your router?

yes ,that would be cool :slight_smile:

Does the standard way of adding your PS1 changes to ~/.bashrc not work?

Did a quick check, in ~/.bashrc there is #force_color_prompt=yes. If I uncomment it then I get a color prompt in operation mode and it does survive a reboot.

yes ,good idea ,but it will not impact config mode

Yes, you are right. It won’t affect config mode. What would be your goal with the prompt being colored?

Like including information in the prompt you don’t get right now? Or different colors for operation and configure mode?

Although I use vyos as primary router ,I also use mikrotik for test and learning , the cli for mikrotik is not bad ,like it . Ros Cli provide full colorful features ,not only PS ,but I guess it would be hard for vyos now to have the similar feature.

Oh I see. I don’t know how much work it would be, or if it is even possible (I assume it is possible).

One would have to create either a feature request (or check if there is/was already one) or implement it themself and create a pull request (ideally with the possibility to switch it on or of)

I do this on our prod routers, so users can tell if they are in OP mode or CONFIG mode

2 Likes

And how do you do it, which config files are you modifying?

Might be a good idea. I made a task at ⚓ T7418 Make console prompts customizable for further discussions.

3 Likes