When I ssh into a particular server, I get a weird prefix that looks like a box with the characters 001B, and a "k" behind the vertical "0B". See the picture below.

enter image description here

How do I fix this?

I think it must be a setting in a bashrc or bash_profile somewhere


1 Answer 1


0x001b is hexadecimal for the escape ASCII sequence. Your prompt contains one or several escape sequences that the terminal can not display. Make sure that your TERM variable is set correctly, or set a more sane primary prompt (PS1) in you shell startup script (probably ~/.bashrc if you're using bash).

  • Thank you. The TERM variable was indeed the problem. For some reason it seems that "screen-256color" doesn't play nice with ssh. Are there any work-arounds? I like the coloring when I am not ssh'ing.
    – Caleb
    Commented Mar 7, 2018 at 14:47
  • screen-256color is meant to be used in screen (GNU Screen). If you're not using screen, and you have a terminal that supports 256 colors, you could try xterm-256color, and if that looks weird too, you could try xterm-color. If your terminal isn't xterm-compatible, and you still want colors, you may be able to use the terminal definition for ansi (export TERM=ansi) Commented Mar 7, 2018 at 14:51
  • 1
    setting TERM=xterm-256color fixes the issue, as well as TERM=ansi. Both fixes work
    – Caleb
    Commented Mar 7, 2018 at 14:55
  • @RDev toe -a (on Ubuntu at least) will list all supported terminals. Pick one that most closely resembles the one you are using. TimKennedy's suggestions seems sound to me.
    – Kusalananda
    Commented Mar 7, 2018 at 14:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .