Open a prompt, try to do this:
- type this code:
export PS1="\e[1;30m-30-\e[m >"
- copy it with your mouse (select the code + copy it (I have auto-copy when I select with the mouse enabled))
- close the prompt
- open a brand new prompt
- immediately paste it (SHIFT INS)
- type "HOME" key and "END" key, you'll see the cursor go to logical positions (start and end of the code)
- now press ENTER
- you prompt changes the colors
- immediately paste it (SHIFT INS)
- type "HOME" key and "END" key, you'll see the cursor go to illogical positions (offset problem)
This means if I apply colors to the prompt I can't copy/paste + change my copied code...
NB: I'm asking it here because I thought it was a problem of wsltty here but it seems it's only related to what I'm trying to assign: export PS1="\e[1;30m-30-\e[m >"
... and I dont see a problem. It should just change the colors of the prompt (and that's what it does actually). But it seems it does something more I dont see. Does somebody know what it could be?
bash
(or I'm not able to follow your instructions). – Kusalananda Oct 29 '18 at 12:02