I just fresh installed Kali 2020.2 and I like their redesign and move to Xfce. However, I noticed fairly quickly that the terminal is causing me issues. I recorded my screen to show the problem, as it's tough to explain:

animated GIF illustrating the below

Basically if I type a long string, it will wrap around and type over the prompt. In addition, when I use the up arrow to look at my history of commands, it will eventually keep a portion of an old command and then lock up the terminal. I have also seen it add crazy space.

Is there anything I can do to help resolve this? Here is some information about my setup:

  1. I am using VirtualBox.
  2. I am using Kali 2020.2, installed from its ISO.
  • 2
    I generally use the word "banjanxed" to find unix.stackexchange.com/q/317734/5132 when people duplicate this question. – JdeBP Jul 22 at 8:28
  • You are a godsend--thanks. It was impossible to figure out how to search for this... thanks! – Tobin Shields Jul 22 at 15:40

Thanks to JdeBP for the explanation to solve this at version 2020.2 of Kali Linux

You have to modify your .bashrc file at sections:

  1. prompt_color=$'\033[01;34m' to prompt_color=$'\[\033[01;34m\]'
  2. path_color=$'\033[01;32m' to path_color=$'\[\033[01;32m\]'
  3. prompt_color=$'\033[01;31m' to prompt_color=$'\[\033[01;31m\]'
  4. path_color=$'\033[01;34m' to path_color=$'\[\033[01;34m\]'

(It's just add \[ before \033)

Then add an export of PS1 at end of .bashrc

export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}${prompt_color}\u@\h\[\033[00m\]:${path_color}\w\[\033[00m\]\$"
| improve this answer | |
  • This didn't quite work... BUT I did go to the linked explanation and borrowed the updated PS1 variable used by the OP and it fixed it! This reminds me that I need to learn more about advanced color prompts... – Tobin Shields Jul 22 at 15:39
  • Should this be reported as a bug to Kali? – Tobin Shields Jul 22 at 15:39
  • Oh damn, I forgot that I had exported PS1 too, i will edit the answer, to export PS1 as come default with Kali 2020.2. Thanks! And yep, should be reported ASAP, it was too difficult to find this answer – Drayko Escobar Jul 22 at 16:17
  • I think someone report it before: Link. This has been fixed with kali-defaults 2020.3.4 – Drayko Escobar Jul 22 at 16:33

Not the answer you're looking for? Browse other questions tagged or ask your own question.