The simplest change required to handle the bracketed paste mode.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user