chris-marsh / pureline

A Pure Bash Powerline PS1 Command Prompt
MIT License
507 stars 95 forks source link

Cursor jumps back three characters when wrapping the first line #61

Closed mad-ady closed 3 years ago

mad-ady commented 3 years ago

Hello, I'm using the latest git pureline version, with this config: https://paste.ubuntu.com/p/cntRQbNmmX/

I have a weird behavior that can be visually seen in this video: https://youtu.be/U4UlqufYGAg

Any ideas where to look for clues? My terminal is xfce4-term, on a Ubuntu 20.04 system.

mad-ady commented 3 years ago

If it helps, a similar recording done with asciinema doesn't show the characters at all: https://asciinema.org/a/a6L8kFACPNe2IBR6lplGUcbEp

chris-marsh commented 3 years ago

Thanks for the videos, thats a great help to try and diagnose the issue. So ... the recording and playback on asciinema is correct. Although while recording in your own terminal you see the cursor issues when wrapping?

mad-ady commented 3 years ago

Yes, I thought a video is worth 1024 words...

Asciinema doesn't render at all the overlapped (overwritten) characters. You can see that the new line has fewer characters than what's echoed back. I initially tried using it to do the recording, but the playback differed from what I was seeing.

On Thu, Mar 25, 2021, 17:30 Chris Marsh @.***> wrote:

Thanks for the videos, thats a great help to try and diagnose the issue. So ... the recording and playback on asciinema is correct. Although while recording in your own terminal you see the cursor issues when wrapping?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chris-marsh/pureline/issues/61#issuecomment-806953575, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAO6KVU7QW2IQQ3ED4OT7LTFNJJXANCNFSM4ZZKUPKQ .

chris-marsh commented 3 years ago

I'm wondering if the '$' symbol in the prompt needs to be escaped. I dont see any difference on my system, but to check, could you disable the prompt module and see if the issue goes away/reduces/changes?

mad-ady commented 3 years ago

You were right - I commented out:

'prompt_module MyDarkGrey White'

and the issue went away.

Is there anything I can do to fix it via configuration?

On Thu, Mar 25, 2021 at 7:35 PM Chris Marsh @.***> wrote:

I'm wondering if the '$' symbol in the prompt needs to be escaped. I dont see any difference on my system, but to check, could you disable the prompt module and see if the issue goes away/reduces/changes?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chris-marsh/pureline/issues/61#issuecomment-807154019, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAO6KTBZAIRCI7HDSO26KLTFNX7HANCNFSM4ZZKUPKQ .

mad-ady commented 3 years ago

I've tested as root and the prompt_module (# in this case) does not cause the cursor to jump back - so only $ causes the issue:

 root  💻 frost  ~  #  echo 1234567890 1234567890 1234567890 1234567890
1234
567890
1234567890 1234567890 1234567890 1234567890 1234567890

On Fri, Mar 26, 2021 at 2:55 PM Adrian Popa @.***> wrote:

You were right - I commented out:

'prompt_module MyDarkGrey White'

and the issue went away.

Is there anything I can do to fix it via configuration?

On Thu, Mar 25, 2021 at 7:35 PM Chris Marsh @.***> wrote:

I'm wondering if the '$' symbol in the prompt needs to be escaped. I dont see any difference on my system, but to check, could you disable the prompt module and see if the issue goes away/reduces/changes?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chris-marsh/pureline/issues/61#issuecomment-807154019, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAO6KTBZAIRCI7HDSO26KLTFNX7HANCNFSM4ZZKUPKQ .

chris-marsh commented 3 years ago

I've pushed a fix, escaping the $ into main. Hopefully this resolves the issue?

mad-ady commented 3 years ago

Thank you. I have updated my pureline install and so far the issue doesn't reproduce anymore! Cheers!

On Mon, Mar 29, 2021 at 11:36 PM Chris Marsh @.***> wrote:

I've pushed a fix, escaping the $ into main. Hopefully this resolves the issue?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chris-marsh/pureline/issues/61#issuecomment-809695712, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAO6KXUCKQ6EVEWQDLWAZ3TGDXFTANCNFSM4ZZKUPKQ .