You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting started with this library and running into some issues. I want to be able to capture NCKEY_RESIZE event in order to let my app know the terminal has been resized. My code does not appear to be working. I have simplified the code as follows:
import notcurses as nc
import sys
def main():
nc_obj = nc.Notcurses()
try:
std_plane = nc_obj.stdplane()
std_plane.putstr("Resize the terminal to see the event. Press any key to exit.")
nc_obj.render()
while True:
# Wait for an event
key_event = nc_obj.get(None)
if key_event is not None:
# Check if it's a resize event
if key_event.id == nc.NCKEY_RESIZE:
std_plane.erase()
std_plane.putstr("Terminal resized! Press any key to exit.")
nc_obj.render()
else:
# Exit on any other key press
break
except:
print("ERROR")
sys.exit(0)
if __name__ == "__main__":
main()
Intended behavior: I resize the terminal and see the Terminal resized! Press any key to exit. confirmation.
Hello,
Getting started with this library and running into some issues. I want to be able to capture
NCKEY_RESIZE
event in order to let my app know the terminal has been resized. My code does not appear to be working. I have simplified the code as follows:Intended behavior: I resize the terminal and see the
Terminal resized! Press any key to exit.
confirmation.Observed behavior: Nothing happens
Please include the following data:
export | egrep 'LANG|LC_CTYPE|TERM'
notcurses-demo i
)Kitty Version 0.37.0 (0.37.0)
The text was updated successfully, but these errors were encountered: