cursive
cursive copied to clipboard
Cannot debug
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
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.
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
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.
Thank you very much. I appreciate that.