Open aarondill opened 1 year ago
Not sure if there's a particular key binding to exit "properly" but pkill -2 awrit
should send SIGINT
(as ctrl + c
does) instead of SIGTERM
sent by pkill awrit
.
EDIT: Default is SIGTERM
, not SIGKILL
.
Hm, strange that Ctrl+C stopped working. If you want to play around with it, the intercept code is here: https://github.com/chase/awrit/blob/main/awrit/input_event_handler.cc#L23-L30
Realistically, awrit should have a signal handler to handle any terminating event and exit cleanly.
I'm rather busy for a while so I can't put time into this right now, but if you figure out a fix for this I'll gladly accept a PR
Not sure if there's a particular key binding to exit "properly" but
pkill -2 awrit
should sendSIGINT
(asctrl + c
does) instead ofSIGKILL
sent bypkill awrit
.
According to man pkill
:
pkill will send the specified signal (by default SIGTERM) to each process instead of listing them on stdout.
While SIGTERM
is not the same as SIGINT
, they should both be handled (nearly) identically by every program, and unlike SIGKILL
can and should be caught before cleanup.
Infact, it seems to be caught and handled the same as SIGINT
here, which means any signal that is passed will be treated identically. It seems that it just doesn't reset terminal attributes?
According to
man pkill
:pkill will send the specified signal (by default SIGTERM) to each process instead of listing them on stdout.
Sorry, that was an error on my part. Corrected it.
Infact, it seems to be caught and handled the same as
SIGINT
here, which means any signal that is passed will be treated identically. It seems that it just doesn't reset terminal attributes?
Oh, I see... thanks.
I just made a fresh build and I can't reproduce this issue in Kitty. It correctly resets the terminal attributes.
I believe this might be a wezterm-specific issue. While wezterm should mostly work, there are bound to be issues like this that arise since I primarily use and test things in Kitty.
Detecting if things are running in wezterm and apply additional fixes is probably the best we can do in this case. I'm still busy unfortunately, so I'd appreciate any PRs, hacky or not 🙂
I also was having problems with ctrl+c -- turns out, doing ctrl+c + c (ctrl+c followed by another c while holding ctrl) works. I don't know why that's happening.
Issue: After exiting awrit (using
pkill awrit
bc ctrl+c doesn't work for me :disappointed:), moving the mouse results in escape codes being written to the terminal. This is fixed by atput reset
.Expected behavior:
awrit
sets the terminal attributes to their previous values, or if impossible, then resets them to default (essentiallytput reset
)Environment: wezterm 20230712-072601-f4abf8fd on Ubuntu 22.04.2 LTS