VT-IME

VT-IME

Timeline:

TL;DR: VT-IME brings CJK input to FreeBSD's vt(4) console through librime. I began the project during Google Summer of Code 2021 and presented the work in 2023.

Chinese text composition and candidate selection in a FreeBSD virtual terminal
VT-IME composing Chinese text inside vt(4)

Background

During college, I was one of the members of our department's IT center. We had to debug our FreeBSD servers, and sometimes the network itself was the problem. In those cases, there was no way for me to open a terminal on my laptop and connect remotely. I had to use the local console, which was painful when I wanted to take notes in Chinese.

This is why I proposed VT-IME to FreeBSD for Google Summer of Code 2021.

Building the prototype

I started with the backend, inspired by emacs-rime. I wrote a small C wrapper around librime and loaded it from Python with ctypes. The backend kept running in the background so it could remember what I was typing between key presses.

Before changing the kernel source, I built tmux-rime as a testbed. The tmux status line let me quickly try the backend and decide how the input should look. After it worked, I moved the frontend into the FreeBSD console.

When I moved the frontend into the kernel, I still used a network socket to talk to the IME server in user space. I changed the key handling and screen rendering in vt(4) to make it work.

Results

It works, cool! The current version is still too hacky to put into FreeBSD's src, so I am still working on it. I also plan to extend it with accessibility features such as screen readers. Stay tuned! (2026)

Related Links

I also presented this project at AsiaBSDCon and BSDCan.

Created by Org Static Blog