Ismael-VC
Ismael-VC
TTermux
Created by Ismael-VC on 7/21/2024 in #support
CTRL+ENTER not working?
Hello everyone! I am trying to write an app that needs to diferentiate between carriage return and line feed with stty raw -echo modes. When I test it in WSL2 it works this way: * CR: ENTER * LF: ^ENTER I plan to use this so I can make a REPL that allows multiline input editing (the language does not have block delimiters nor significant whitespace), currently I use brackets
➜ ~ merlin

|_ Merlin OS -- v0.e (18M06)
|_| | (c) 2024 Ismael Venegas Castello
| Type 'bye' to exit.

Ready
@msg-str [
"Brakets 20 "allow 20 "multiline
20 "input 20 "for 20 "now 20 "using
20 "stty 20 "canonical 20 "mode. 0a00
]
ok
;msg-str pzstr
Brakets allow multiline input for now using stty canonical mode.
ok
➜ ~ merlin

|_ Merlin OS -- v0.e (18M06)
|_| | (c) 2024 Ismael Venegas Castello
| Type 'bye' to exit.

Ready
@msg-str [
"Brakets 20 "allow 20 "multiline
20 "input 20 "for 20 "now 20 "using
20 "stty 20 "canonical 20 "mode. 0a00
]
ok
;msg-str pzstr
Brakets allow multiline input for now using stty canonical mode.
ok
However brackets are used in Uxntal for grouping and don't have any semantic meaning, with this in mind I thought to use double enter instead of brackets to end an expression, but from a UX point of view, typing enter twice just to finish any expression is not good Then I learned about the non canonical input method without echo, I want to make this work so I can use CTRL+ENTER to add a newline without JIT assembling the input and executing it, so that when it is ready to be processed, a simple ENTER would do the job, this is the interaction I expect to have
➜ ~ merlin

|_ Merlin OS -- v0.e (18M06)
|_| | (c) 2024 Ismael Venegas Castello
| Type 'bye' to exit.

Ready
@msg-str ( ^ENTER LF 0a )
"CR 20 "and 20 "LF 20 "would 20 "allow 20 ( ^ENTER LF 0a )
"multiline 20 "input 20 20 "using 20 "stty ( ^ENTER LF 0a )
20 "non 20 "canonical 20 "mode 20 "without ( ^ENTER LF 0a )
20 "echo. 090a 00 ( ^ENTER LF 0a )
( ENTER CR 09 )
ok
;msg-str pzstr ( ENTER CR 09 )
CR and LF would allow multiline input using stty non canonical mode without echo.
ok
➜ ~ merlin

|_ Merlin OS -- v0.e (18M06)
|_| | (c) 2024 Ismael Venegas Castello
| Type 'bye' to exit.

Ready
@msg-str ( ^ENTER LF 0a )
"CR 20 "and 20 "LF 20 "would 20 "allow 20 ( ^ENTER LF 0a )
"multiline 20 "input 20 20 "using 20 "stty ( ^ENTER LF 0a )
20 "non 20 "canonical 20 "mode 20 "without ( ^ENTER LF 0a )
20 "echo. 090a 00 ( ^ENTER LF 0a )
( ENTER CR 09 )
ok
;msg-str pzstr ( ENTER CR 09 )
CR and LF would allow multiline input using stty non canonical mode without echo.
ok
Uxntal: https://wiki.xxiivv.com/site/uxntal.html Thanks!
20 replies