sncli icon indicating copy to clipboard operation
sncli copied to clipboard

Cursor not displayed when using VIM as editor.

Open ZaxonXP opened this issue 6 years ago • 21 comments
trafficstars

When I open sncli in uxterm I have a nice colors of the notes. However when I start editing the note in my VIM editor, then I do not see the cursor, so it is hard to edit.

If I close sncli and open VIM in the same terminal I can see the cursor. Is this sncli issue or do I need to change something somewhere else?

I tried with nano and xfce4-terminal I had the same issue.

ZaxonXP avatar Dec 04 '18 12:12 ZaxonXP

Yeah I've had that issue before. Unfortunately I can't remember what caused it. I believe it's related to how the sncli ui hides the terminal cursor and for some reason it doesn't get reset when launching the editor. I'll let you know if I find anything more.

samuelallan72 avatar Dec 04 '18 12:12 samuelallan72

@ZaxonXP What colors are you talking about ? I have colors only in:

  • the list of notes
  • inside a note with markdown

N0ury avatar Dec 04 '18 12:12 N0ury

@nbenm If I hit e on any note in order to edit it my editor will load (vim) but the cursor is hidden, so it is hard to edit anything without seeing the cursor.

ZaxonXP avatar Dec 04 '18 12:12 ZaxonXP

@ZaxonXP which version of urwid do you have installed? Apparently older versions are known to have that behaviour.

EDIT: pip show urwid from the same environment as sncli should get the version

samuelallan72 avatar Dec 04 '18 12:12 samuelallan72

pip3 install urwid
Requirement already satisfied: urwid in /usr/local/lib/python3.5/dist-packages (2.0.1)

ZaxonXP avatar Dec 04 '18 12:12 ZaxonXP

Hmm that's the latest version. Not sure what is going on. :/

samuelallan72 avatar Dec 04 '18 12:12 samuelallan72

Is there any other action I can do to help to debug it?

Debian GNU/Linux 9.6 (stretch)

ZaxonXP avatar Dec 04 '18 12:12 ZaxonXP

I don't have this issue on Mac. I have tried uxterm with XQuartz, and OsX Terminal app In both cases I can see the cursor in edit mode. I use urwid 2.0.1 too.

N0ury avatar Dec 04 '18 12:12 N0ury

For the time being is there a way to use GUI editor somehow?

Currently if I set up EDITOR=gvim and edit a note then editors open with an empty temp file and sncli goes back to displaying the list of notes.

ZaxonXP avatar Dec 04 '18 12:12 ZaxonXP

@ZaxonXP if you have a .vimrc file, you can try to rename it and try again

N0ury avatar Dec 04 '18 13:12 N0ury

Renamed .vimrc file, but this did not change anything. :(

ZaxonXP avatar Dec 04 '18 13:12 ZaxonXP

Renamed .vimrc file, but this did not change anything. :(

Yes, I didn't see that you have the same issue with nano... I'll try on a debian unstable tomorrow and tell you how it works.

N0ury avatar Dec 04 '18 13:12 N0ury

Currently if I set up EDITOR=gvim and edit a note then editors open with an empty temp file and sncli goes back to displaying the list of notes.

Yes sncli isn't compatible with editors that fork. You can use gvim if you pass the -f flag (stay in foreground):

cfg_editor = gvim -f

samuelallan72 avatar Dec 05 '18 03:12 samuelallan72

I have just tried on Debian (unstable) with uxterm. It works fine, cursor is visible in edit mode with vim.

N0ury avatar Dec 05 '18 15:12 N0ury

But I do not want to use unstable version. :(

ZaxonXP avatar Dec 05 '18 19:12 ZaxonXP

I'm on a stable Ubuntu, when I hit space for editing, the red highlight disappears to enter in editor mode but the cursor is not appearing because it is not entered in vim edition mode, every key like q for quit or j and k to move up/down are still activated

Haikyy avatar Jul 13 '19 17:07 Haikyy

@Haikyy What terminal emulator are you using? Also can you post the output of echo $TERM?

samuelallan72 avatar Jul 14 '19 23:07 samuelallan72

@swalladge: In my case echo $TERM shows xterm-color and in all terminals I use (xterm, uxterm, xfce4-terminal) cursor is not visible when I edit (Debian 9.9 x64).

ZaxonXP avatar Jul 15 '19 07:07 ZaxonXP

@ZaxonXP Debian 10 has been released. Maybe you can upgrade and try again.

N0ury avatar Jul 15 '19 09:07 N0ury

@swalladge it's the default gnome terminal on Ubuntu 18.04. echo $TERM-> xterm-256color

Haikyy avatar Jul 15 '19 10:07 Haikyy

@ZaxonXP Debian 10 has been released. Maybe you can upgrade and try again.

@nbenm : I just upgraded to Debian 10 and indeed it is working correctly (cursor is visible in vim). :)

ZaxonXP avatar Jul 17 '19 19:07 ZaxonXP