mirror of
https://git.sr.ht/~nabijaczleweli/tzpfms
synced 2025-04-15 09:40:32 +03:00
Correctly echo intr instead of hard ^C
This commit is contained in:
parent
47cd20aa32
commit
1ae0e258a7
@ -155,7 +155,10 @@ static int get_key_material_raw(const char * whom, bool again, bool newkey, uint
|
||||
caught_interrupt = 0;
|
||||
act.sa_handler = [](auto sig) {
|
||||
caught_interrupt = sig;
|
||||
fputs("^C\n", stderr);
|
||||
|
||||
struct termios cur;
|
||||
tcgetattr(0, &cur);
|
||||
fprintf(stderr, "%s^%c\n", (cur.c_cc[VINTR] & 0x80) ? "M-" : "", ((cur.c_cc[VINTR] & 0x7F) == 0x7F) ? '?' : ('@' + (cur.c_cc[VINTR] & 0x7F)));
|
||||
};
|
||||
sigaction(SIGINT, &act, &osigint);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user