Life in a TTY
| CommentI make no secret of my appreciation of text user interfaces for a lot of tasks (eg for browsing and for writing). Still, I normally use X and a Terminal Emulator under a graphical Desktop Environment. A lot of the other things I do with a computer are simply not practical without a mouse and some sort of a “canvas” interface.
Recently though, I had to send my laptop for service, and I don’t have it back yet. I still need some sort of a portable computer for my writing though, so I had to unearth my very old, very underpowered netbook from 2009. Underpowered as it is, I kept using it for a long time (mainly because of its long battery life), and only stopped because its touchpad and some keyboard keys broke. But this old machine got a second chance this month.
Now, if the touchpad wasn’t broken, I would probably install some sort of window manager – Openbox is the one I’m most used to. The last time I went GUI-lite I also used Openbox and a full-screen Terminal Emulator. But this time it’s straight to a virtual console, or a TTY. No X Server, no framebuffer device. How hard can it be?
Well, it isn’t hard. So far all the “big things” work. The problems I came across are technological limitations of the virtual console, and not lack of CLI or TUI tools.
So, as a review of the experience…
Software
A lot of the tools I already use, like tmux, elinks, and vim followed me to this TTY experience. Along the way, I discovered some new programs that really impressed me.
Tmux
This is essential. Tmux is a terminal multiplexer, which is just like a tiling window manager, but for your console. It allows you to split your console into panes (think of graphical windows), and it can create windows (think of graphical workspaces). Additionally it provides you with a status bar (think of a graphical system tray), and a clipboard mechanism that virtual consoles lack.
I already used tmux on my machine, especially when connecting to remote hosts, but on an X-less computer, tmux becomes your desktop environment.
Tmux can be extended by plugins.
Vim
I don’t know if Vim requires any introduction. It’s a powerful text editor, it’s very resource efficient, it allows you to do complex text manipulations through intuitive shortcuts, and the Markdown highlighting it offers is very pretty.
I extend my Vim setup with:
- Spell checking
let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell'
nn <F7> :setlocal spell! spelllang=en_gb,el<CR>
map <F10> :NERDTreeToggle<CR>
let g:transliterateMode = 'xsampa'
nn <F6> <Plug>TransliterateApply
vmap <F6> <Plug>TransliterateApply
Midnight Commander
Again, an introduction is not necessary. MC is the to-go filemanager for the terminal.
Bashmount
That was an amazing new find for me. Without the automations of a modern GNU/Linux Desktop Environment, handling removable disks can be a bit of a headache. Bashmount makes it very easy to mount and unmount removable disks, and to my surprise, it can also mount LUKS encrypted volumes. I took advantage of this, storing my SSH and GPG keys in an encrypted partition, and symlinking them to ~/.ssh
and ~/.gnupg
.
Network Manager CLI and TUI
NetworkManager is one of those modern desktop tools that make it easy to connect to new networks without a lot of low-level meddling. Fortunately, nm has a very easy to use terminal interface, as well as a TUI based on ncurses. The TUI is good enough for simple WEP/WPA/WPA2 networks, but for more complicated setups, like PEAP authentication, the CLI was needed. It guides you through configuring a new network though.
Review
My use-case for this setup is very specific. 90% of the time I am writing in vim
, 5% of the time I am reading back from other documents, and 5% of the time I am either browsing in elinks
, or ssh
ing in another machine. I’m not doing anything that really requires a GUI, and I am not even doing everything that is possible under a TTY. The setup is actually covering my needs, except for one thing: proper Unicode support.
The virtual console has a hard limitation: its fonts (special fonts, not TrueType or OpenType) cannot contain more than 500 glyphs. As someone who works with multilingual text and special characters, this is frustrating. I can type in IPA in vim
, but I cannot display IPA characters. I can display Latin, Greek, and Cyrillic, but CJK seems tricky, or even impossible.
I also miss the comforts of Compose Key and ibus-tables
.
As far as I know, all those problems can be solved by switching to a framebuffer device. I might do that, but at that point, I might as well return to X
+ a fullscreen terminal emulator.
Let me know what you think about this via email or in the public chatroom.
Category: Software