moson-mo / pacseek

A terminal user interface for searching and installing Arch Linux packages
MIT License
323 stars 8 forks source link

Terminal cursor change after quitting pacseek #19

Closed vaygr closed 1 year ago

vaygr commented 1 year ago

So I have underline as a terminal cursor.

After quitting pacseek it's reset to block, which pacseek uses I assume.

moson-mo commented 1 year ago

I'm not aware that pacseek (or the library that is being used) can even change the cursor style. Isn't that even a pure terminal-emulator setting?

Please provide more information:

  1. Terminal emulator
  2. Shell
  3. How/Where did you set up the cursor style
vaygr commented 1 year ago

I wonder if it comes from the Go library..

  1. st 0.8.5 with the patch
  2. bash 5.1.016
  3. see the patch in 1., but it's set via ~/.Xresources with st.cursorstyle: 3 after applying this patch
vaygr commented 1 year ago

A temporary workaround for me could be this:

$ alias pacseek='pacseek; echo -e -n "\x1b[\x33 q"'

But it would be better for pacseek to not mess up with the cursor in the first place if possible.

moson-mo commented 1 year ago

Yepp I can reproduce it.

Seems it's connected to this commit in the upstream library https://github.com/gdamore/tcell/commit/761abf6821d766b234f301ec681ab63039d8d189

Only seems to happen with the InputField component of tview 🤔

Will probably take some time and involvement of the library devs to get it fixed. Need to do some more analysis on this.

Good that you have a workaround for now. 😉

moson-mo commented 1 year ago

Hey @vaygr

Seems there is no proper way to detect the "current style". See https://github.com/gdamore/tcell/issues/559#issuecomment-1244225876 Setting up the default style in the terminal emulator settings should do the trick. Now, I don't know if that is an options in st, but in xfce4-terminal doing it this way, it works fine. If not, I'm afraid you'll have to live with the workaround.

vaygr commented 1 year ago

I see.

Well, the above patches do just that. But my assumption is that xfce4-terminal always makes sure the cursor stays as assigned, while st does so only on init.

Thanks for investigating!

vaygr commented 1 year ago

Yeah, I just checked: echo -e -n "\x1b[\x30 q" has no effect in xfce4-terminal when the cursor set to blinking underline.