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
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
Uxntal: https://wiki.xxiivv.com/site/uxntal.html
Thanks!6 Replies
why don't you implement your REPL to hold execution if there's incomplete bracket?
Hello Komo!
That is the way it currently works, however I found that ENTER and ^ENTER send different bytes and it made me thought that this could be a better solution as I want this system to be 100% compatible with uxntal (I did not invent the language)
It all started by wanting to make a repl for uxntal. However I ended up making a complete OS as Varvara (the virtual PC that uses Uxn (the virtual CPU) is an 8bit computer with 16bits addressing and 64Kb of memory)
I use my android with Termux for most of the development I do. Sometimes I get a Windows with WSL2 lended, when I tested and codes in win/WSL2 I noticed that ^ENTER and ENTER were different, but when I tested in Termux it didn't work.
I want this system to work reliably in Win/wsl, Linux, Mac and Termux because I want it to be useful for others and possibly write a booklet tutorial down the line about Varvara/Uxn using Uxntal.
I don't want to change the syntax nor semantics of Uxntal.
That is my only constraint.
@Komo — /'koʊmoʊ/ here is a video with the issue in Termux:
* https://youtu.be/vYY1PJg1pCk?si=WzXexTosnbteTwqC
Here is how the ANSI codes behave in Windows 11 with WSL2:
* https://youtu.be/L0_RYXkmDqY?si=n_XfFK8BWC6ArkN0
i'm just assuming it's probably how Termux handle Ctrl key
it won't register Ctrl+Enter as ^ENTER because of that
Yeah, this doesn't work either:
I guess I'll just use ctrl+enter in wsl and alt+enter in termux
So I only need an assembly time option, but I'll need different roms for different OSs
At least in Termux Alt can be right next to Ctrl
(in physical keyboards I swap ctrl <-> caps lock)
Thank you for your help 🙏