cursive icon indicating copy to clipboard operation
cursive copied to clipboard

Cannot debug

Open smallB007 opened this issue 4 years ago • 4 comments

Hi, I cannot debug my project, because of error I'm getting: thread 'main' panicked at 'called Result::unwrap() on an Err value: Custom { kind: Other, error: "$TERM is unset. Cannot initialize ncurses interface." }'

Is there something I can do to prevent it to happen?

Thank you

smallB007 avatar Jul 23 '20 14:07 smallB007

Hi, and thanks for the report!

It seems your TERM environment variable is not set. This variable is usually automatically set by the terminal emulator; are you overriding it somehow? It's necessary to know how to parse the various escape codes sent by the terminal; these can vary between emulators, and ncurses requires it.

You can also try other backends; currently, both termion and crossterm ignore this variable. As a result, they are less portable, but at least should work fine even without this variable.

gyscos avatar Jul 23 '20 19:07 gyscos

You can also try other backends; currently, both termion and crossterm ignore this variable

Thank you very much for your reply. I'm very new to rust, would you mind showing me how to do it? Thank you

smallB007 avatar Jul 25 '20 10:07 smallB007

You can check the wiki: https://github.com/gyscos/cursive/wiki/Backends

Basically, add either the crossterm-backend or termion-backend feature to the cursive dependency.

That being said, a missing TERM variable is usually an indicator of a serious issue with the terminal, and it's not guaranteed other backends will work as expected.

gyscos avatar Jul 29 '20 18:07 gyscos

Thank you very much. I appreciate that.

smallB007 avatar Jul 30 '20 07:07 smallB007