Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor not displayed when using VIM as editor. #78

Open
ZaxonXP opened this issue Dec 4, 2018 · 21 comments
Open

Cursor not displayed when using VIM as editor. #78

ZaxonXP opened this issue Dec 4, 2018 · 21 comments

Comments

@ZaxonXP
Copy link

ZaxonXP commented Dec 4, 2018

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.

@samuelallan72
Copy link

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.

@N0ury
Copy link

N0ury commented Dec 4, 2018

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

  • the list of notes
  • inside a note with markdown

@ZaxonXP
Copy link
Author

ZaxonXP commented Dec 4, 2018

@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.

@samuelallan72
Copy link

samuelallan72 commented Dec 4, 2018

@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

@ZaxonXP
Copy link
Author

ZaxonXP commented Dec 4, 2018

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

@samuelallan72
Copy link

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

@ZaxonXP
Copy link
Author

ZaxonXP commented Dec 4, 2018

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

Debian GNU/Linux 9.6 (stretch)

@N0ury
Copy link

N0ury commented Dec 4, 2018

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.

@ZaxonXP
Copy link
Author

ZaxonXP commented Dec 4, 2018

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.

@N0ury
Copy link

N0ury commented Dec 4, 2018

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

@ZaxonXP
Copy link
Author

ZaxonXP commented Dec 4, 2018

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

@N0ury
Copy link

N0ury commented Dec 4, 2018

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.

@samuelallan72
Copy link

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

@N0ury
Copy link

N0ury commented Dec 5, 2018

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

@ZaxonXP
Copy link
Author

ZaxonXP commented Dec 5, 2018

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

@Haikyy
Copy link

Haikyy commented Jul 13, 2019

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

@samuelallan72
Copy link

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

@ZaxonXP
Copy link
Author

ZaxonXP commented Jul 15, 2019

@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).

@N0ury
Copy link

N0ury commented Jul 15, 2019

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

@Haikyy
Copy link

Haikyy commented Jul 15, 2019

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

@ZaxonXP
Copy link
Author

ZaxonXP commented Jul 17, 2019

@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). :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants