Glam Prestige Journal

Bright entertainment trends with youth appeal.

┌──(kali㉿kali)-[~]
└─$

I want this to be in one line on terminal like it was before I updated kali. I tried changing bashrc on kali user and on root user there was no update.

9

7 Answers

Edit your .zshrc file and change the variable PROMPT like so:

PROMPT=$'%F{%(#.blue.green)}${debian_chroot:+($debian_chroot)──}(%B%F{%(#.yellow.blue)}%n%(#.💀.㉿)%m%b%F{%(#.blue.green)})-[%B%F{reset}%(6~.%-1~/…/%4~.%5~)%b%F{%(#.blue.green)}]%B%(#.%F{yellow}#.%F{blue}$)%b%F{reset} '

You can also get rid of the newline between prompts. Just change this variable to "no": new_line_before_prompt=no

While I was at it I also changed the color red to yellow, because It was popping out too much to me.

In order for the changes to take effect you must restart the terminal.

1

Three options are there so you can choose your preferred configuration, as depicted below first, edit the zshrc with your favorite editor; after that, replace the PROMPT_ALTERNATIVE and NEWLINE_BEFORE_PROMPT accordingly.

$ nano ~/.zshrc

0xfk :kali prompt config 0xfk

0xfk :kali prompt oneline

When done refresh the terminal to apply the new changes

$ source ~/.zshrc

In addition to the above answer, if you would like to revert to a simple one liner (without blue brackets and parentheses or icons):

nano ~/.zshrc

Then edit the line to be

PROMPT='${debian_chroot:+($debian_chroot)}%B%F{%(#.red.blue)}%n%(#.@.@)%m%b%F{reset}:%B%(6~.%-1~/…/%4~.%5~)%b%B%(#.%F{red}#.%F{blue}$)%b%F{reset} '

Would also recommend turning off $new_line_before_prompt

1

Another option is to use bash instead of zsh. Since you already edited the .bashrc file, just run bash in the prompt to test your edits. To make permanent, you can edit /etc/passwd, making /usr/bin/bash your default shell:

┌──(root💀blackbox01)-[~]
└─# vim /etc/passwd
...
root:x:0:0:root:/root:/bin/bash ##<< instead of /usr/bin/zsh
...
### reboot
...
root@blackbox01:~#
root@blackbox01:~#
2

Kali has very simple command utility for this purpose:

kali-tweaks

source:

1

Very easy solution! Type in the terminal "kali-tweaks", then go to "shell and prompt" then "configure prompt" move cursor to "one line" and press space then apply and you re done!

1

In ~/.zshrc there's a kali config variable named PROMPT_ALTERNATIVE, possible values oneline, twoline(default value) and a keybinding ^P (Ctrl+P) is associated with it. Using this one can toggle between the two possible alternatives.

img1: in dot zshrc config file,img2: observable change on terminal interface

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy