git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change of vterm handling logic on backend chardev input event (#40)
[lunaix-os.git]
/
lunaix-os
/
hal
/
term
/
lcntls
/
ansi_cntl.c
diff --git
a/lunaix-os/hal/term/lcntls/ansi_cntl.c
b/lunaix-os/hal/term/lcntls/ansi_cntl.c
index 0596a7a64af40a6a26d8f5f02d080ae9216b5bf0..bc66139cb98abd4c67b9e99f9e0d83909142d56b 100644
(file)
--- a/
lunaix-os/hal/term/lcntls/ansi_cntl.c
+++ b/
lunaix-os/hal/term/lcntls/ansi_cntl.c
@@
-9,26
+9,18
@@
* @copyright Copyright (c) 2023
*
*/
* @copyright Copyright (c) 2023
*
*/
-#include
<hal/term.h>
+#include
"lcntl.h"
#include <usr/lunaix/term.h>
#define CTRL_MNEMO(chr) (chr - 'A' + 1)
#include <usr/lunaix/term.h>
#define CTRL_MNEMO(chr) (chr - 'A' + 1)
-
static inline size_
t
-__ansi_actcontrol(struct
term* termdev, struct linebuffer* lbuf
, char chr)
+
in
t
+__ansi_actcontrol(struct
lcntl_state* state
, char chr)
{
{
- struct rbuffer* cooked = lbuf->next;
- switch (chr) {
- default:
- if ((int)chr < 32) {
- rbuffer_put(cooked, '^');
- chr += 64;
- }
- break;
+ if (chr < 32 && chr != '\n') {
+ lcntl_put_char(state, '^');
+ return lcntl_put_char(state, chr += 64);
}
}
- return
rbuffer_put(cooked
, chr);
+ return
lcntl_put_char(state
, chr);
}
}
-
-struct term_lcntl ansi_line_controller = { .process_and_put =
- __ansi_actcontrol };
\ No newline at end of file