diff options
Diffstat (limited to 'ptyim.html')
-rw-r--r-- | ptyim.html | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/ptyim.html b/ptyim.html new file mode 100644 index 0000000..c16dc79 --- /dev/null +++ b/ptyim.html @@ -0,0 +1,72 @@ +<!DOCTYPE html> +<head> +<title>Non-Janky Input Method for the Linux Console (and other Terminals)</title> +<meta charset="utf-8"/> +<link rel="stylesheet" href="https://hairydiode.xyz/style.css"/> +<link rel="icon" type="image/png" href="https://hairydiode.xyz/img/fav/logo.png"/> +</head> +<body> +<div class="content"> +<pre> +<!-- +123456789-223456789-323456789-423456789-523456789-623456789-723456789-8234567890 +一二三四 +-->-------------------------------------------------------------------------------- + +<a href="https://hairydiode.xyz">>HairyDiode</a> + +-------------------------------------------------------------------------------- +<!-- +123456789-223456789-323456789-423456789-523456789-623456789-723456789-8234567890 +一二三四--> +Non-Janky Input Method for the Linux Console (and other Terminals) 09-06-2025 +-------------------------------------------------------------------------------- + +I've implemented boshiamy in a lot of convoluted ways so far. I've done it using +<a href="https://hairydiode.xyz/jankime">bash scripts</a> and using <a href="https://hairydiode.xyz/xkbabuse">xkb compose rules</a>. + +But the reason I've been trying to do this to be able to use an input method in +the Linux Console, and eventually a physical terminal. Back in the day they had +zhcon, which was a userspace virtual console with the input method built in, but +it's ugly and only supports dbcs encoding. + +I've also been building a real world physical serial terminal, and having the +input method implemented in software saves me the trouble of trying to fit it +inside of microcontroller ROM. + +One Idea I've had for a while is to simply write an input method that sits +between the terminal/console and whatever program is running. If tmux can do it +so can I, right? + +After digging through a LOT of manpages I finally made my idea true. It's a +program that creates a pseudoterminal with a shell (or your program of choice) +attached to it, and routes all input through an input method before it reaches +the pseudo terminal. + +I had to mess around with a bunch of stuff like low level POSIX termios +libraries, obscure linux system calls, session/process groups, and even terminal +escape codes. Luckily, almost everything I needed was in the manpages. + +The final implementation should be encoding agnostic, although it does make some +assumptions about the terminal you're using. All this can be changed by +modifying some macros. + +Testing so far it works on st, the linux console, kmscon and other terminal +emulators. It's compatible with pretty much every ncurses program I tried. + +Special Thanks to: + - 何震邦(jdh8) for this <a href="https://github.com/jdh8/ibus-boshiamy">ibus boshiamy implementation</a> I based my IM table + off of + - Linux Akesson for this <a href="https://www.linusakesson.net/programming/tty/">writeup</a> which explained a everything + about how ttys work on linux + +Code and further reading are in a git repo <a href="https://hairydiode.xyz/cgit/ptyim">here</a> +</pre> +</div> +<br> +<br> +</body> +<!-- +if you're digging in the src you might be interested in how this site works +here: https://hairydiode.xyz/meta2 +--> |