[TITLE] [DATE] -------------------------------------------------------------------------------- [SETTITLE]Non-Janky Input Method for the Linux Console (and other Terminals) [SETDATE]09-06-2025 I've implemented boshiamy in a lot of convoluted ways so far. I've done it using bash scripts and using xkb compose rules. 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 ibus boshiamy implementation I based my IM table off of - Linux Akesson for this writeup which explained a everything about how ttys work on linux Code and further reading are in a git repo here