Add a passthrough mode flag
Alpine 3.23 Success

The simplest change required to handle the bracketed paste mode.
This commit is contained in:
2026-07-19 05:56:02 +02:00
parent f9a102456f
commit a8f3f6eca3
3 changed files with 19 additions and 2 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
Copyright (c) 2007-2014 Paul Evans <leonerd@leonerd.org.uk>
Copyright (c) 2014-2021 Přemysl Eric Janouch <p@janouch.name>
Copyright (c) 2014-2026 Přemysl Eric Janouch <p@janouch.name>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+15
View File
@@ -893,6 +893,21 @@ peekkey (termo_t *tk, termo_key_t *key, int flags, size_t *nbytep)
tk->hightide = 0;
}
// A simple way of getting access to raw data, including the buffer.
if (tk->flags & TERMO_FLAG_PASSTHROUGH)
{
if (tk->buffcount == 0)
return tk->is_closed ? TERMO_RES_EOF : TERMO_RES_NONE;
key->type = TERMO_TYPE_KEY;
key->modifiers = 0;
key->multibyte[0] = key->code.codepoint = CHARAT (0);
key->multibyte[1] = 0;
*nbytep = 1;
return TERMO_RES_KEY;
}
termo_result_t ret;
termo_driver_node_t *p;
for (p = tk->drivers; p; p = p->next)
+3 -1
View File
@@ -196,7 +196,9 @@ enum
// Return ERROR on signal (EINTR) rather than retry
TERMO_FLAG_EINTR = 1 << 7,
// Do not call termkey_start() in constructor
TERMO_FLAG_NOSTART = 1 << 8
TERMO_FLAG_NOSTART = 1 << 8,
// Blindly report every individual input byte as TERMO_TYPE_KEY
TERMO_FLAG_PASSTHROUGH = 1 << 9
};
enum