Loading video...

Video Failed to Load

Go Home

Terminal text editors are an evolutionary dead-end

67,839 views • 11 months ago •via X (Twitter)

60 Comments

HSVSphere's profile picture
HSVSphere11 months ago

This is overall a benefit as there is no way of a program assuming the physical keys are what you want (many games do, even in text input boxes, latest one that I have interacted with that did was the OpenTTD console) which falls into the "make your API hard to misuse" but there

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

Good games distinguish using physical key codes in actual gameplay, and gracefully giving you text events in input boxes. Point being - terminal programs just don't have this ability at all unless they (and emulator too!) implement some kitty protocol that doesn't really do it all that well and has its own quirks.

HSVSphere's profile picture
HSVSphere11 months ago

I don't want the game to do that, as I have no idea where the [ or whatever key is on my keyboard when it is using the US layout. Just translate it all and let me remap, don't assume everyone knows the US layout.

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

Ah yeah I know what you mean. As a kid, you would open a game key remap menu, and it would show WASD and I have no fucking clue what WASD is because my keyboard doesn't have English keycaps :D But still, in a lot of cases a program that has enough information can gracefully handle keyboard layout change and not poop itself like neovim or helix do

HSVSphere's profile picture
HSVSphere11 months ago

I guess the best thing would be to use the physical location _and_ show the localized keycaps

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

Damn it works much better with youtube thumbnail

Chris McGee's profile picture
Chris McGee11 months ago

Thanks for posting this. I hope that someday we can move away from the vt100 and into the modern and multilingual desktop world with our tools.

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

We already sorta did I guess. Neovim is very niche outside of very narrow tech bubble, and helix (the other editor from the video) is researching gui options, which would fundamentally solve this issue.

Chris McGee's profile picture
Chris McGee11 months ago

Editors are one class of tools that can be run in a terminal. I’m thinking of all the other classes of tools out there.

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

oh yeah it's also an issue with terminal mail clients, database cliens, and pretty much everything else.

Chris McGee's profile picture
Chris McGee11 months ago

Worse is that they all end up doing inconsistent things with their own terminal control libraries. It’s like the DOS days all over again. Every app works and looks different.

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

Theoretically, there could be something like kitty keyboard protocol but better, that just straight up forwards physical key codes as is without any preprocessing. But then you'll have 1.5 terminals and programs implementing it maybe in 5 years. And it will still have restrictions and edge cases that aren't handled

Pepe Aoriano's profile picture
Pepe Aoriano11 months ago

“Dead end?” This is rage bait. If someone is using a non English key map they could either implement their input protocol (a-la kitty) or just figure out an input daemon (backed plugged). Terms stick to chars 'cause they're the cross-device (non-just OS) lingua franca. Muted

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

Why non of the major terminal text editors just do it then? :)

Aram Hăvărneanu's profile picture
Aram Hăvărneanu11 months ago

My text editor, Acme, is from 1994, but it's still using 20+ years more modern technology than what people consider good today. It's embarrassing.

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

Да-да, только теперь ctrl-c/ctrl-v надо отдельно маппить и настраивать. Всё те же костыли. И ctrl-z свернёт редактор кек

Ereechepeine Veeph's profile picture
Ereechepeine Veeph11 months ago

И ctrl+z нихуя не свернёт.

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

почему по-твоему тебя заставляют делать шифт+инсерт ) Это всё костыли. Суть в том, то терминальные приложения не видят нажатия кнопок на клавиатуре. Все способы это обойти ломаются, если на них посмотреть не под тем углом. У mc edit свой набор воркараундов. Здесь нет магии, которую мейнтейнеры неовима или любой другой программы могут просто сделать и все починить, к сожалению

Ereechepeine Veeph's profile picture
Ereechepeine Veeph11 months ago

Вот не надо искать проблему не там, где она находится на самом деле. На самом деле все комбинации Ctrl+ и Alt+ должны выдавать нажатия в латинице, как того весь софт и ожидает.

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

Ты наверное еще думаешь, что на свете бывают только две раскладки - US ANSI и русский ЙЦУКЕН :) Чел, ты либо не понял сути ограничений, либо тебя оно почему-то лично задело.

Ereechepeine Veeph's profile picture
Ereechepeine Veeph11 months ago

Ты как раз сам кое-чего не понял: раскладки должны быть для ввода букв, и только для ввода букв. А когда никаких букв подходящих нету в раскладке, то пусть отдают ASCII, чтобы не ломать UI.

Olex (Solo gamedev Diablo-like) 🇺🇸🇺🇦's profile picture
Olex (Solo gamedev Diablo-like) 🇺🇸🇺🇦11 months ago

Just like chopsticks and non-alphabet languages. :P

Omar Mahdi's profile picture
Omar Mahdi11 months ago

Terminals, as a whole, are a dead end. The industry moving back to terminals (e.g., codex) is stupid. They are a subset of GUI programs with historical baggage we don't need. GUIs and human computer interfaces have barely been explored, and yet we are stuck in the 70s 💀.

Caleb Maclennan's profile picture
Caleb Maclennan11 months ago

It's not a dead end! I use a Dvorak variant as my layout but frequently want to insert and edit Turkish or Russian. To do this setup a keymap so that all the VIM keys still work but inserted text is mapped to the other language. Here is my DVP→JCU map:

Petr Skocik's profile picture
Petr Skocik11 months ago

Very nice vid but I disagree. Terminal editors are quite fit for their purpose as programmer editors capable of thriving in minimalist environments. Programmers use English. I'm bilingual too & my 2nd lang, Czech, kinda sucks with vim too. Solution: I just don't use vim with it.

Jesse S's profile picture
Jesse S11 months ago

I'm familiar with the device input mapping (scan codes in this case) across Linux/macOS/Windows and how to solve this problem, I was scrolling before bed and saw this post, so I'll share some code tomorrow which handles everything seamlessly. (I code in C++ mainly, but same same)

Franek Kopara's profile picture
Franek Kopara11 months ago

How you want to read physical key when you connect using ssh?

Deus Lemmus『旅鼠神』's profile picture
Deus Lemmus『旅鼠神』11 months ago

Right. I'll just keep using emacs. I have no issues with any glyphs, keyboards, tabs or anything special. thanks though.

meatball's profile picture
meatball11 months ago

i love vim and agree

Multiple Systems's profile picture
Multiple Systems11 months ago

i fully agree with what you said given that i'm using my own keyboard layout that is not used by almost anyone else:

MoiSoto 🪐's profile picture
MoiSoto 🪐11 months ago

Very interesting video. But are there real people that only use Terminal for “EVERYTHING”? I mean, I’m a terminal junky but even I only use for specific technical stuff.

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

With text editors in particular, it's quite stupid to use one text editor "only for code" and then have to have some other editor for writing "normal text" :/

T. Vuorinen's profile picture
T. Vuorinen11 months ago

I like my Micro, but sometimes it doesn't recognize the keyboard correctly. Then again, WSL shells are absolutely garbage in that regard anyways, which carries to GUI software too. Oh the workarounds!

Milen Todev's profile picture
Milen Todev11 months ago

I use vim keybindings in VSCode and face same issues with the Bulgarian language.

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

It's because vim plugin for vscode goes through actual neovim afaik, and that one needs characters instead of key codes, so you just get screwed for the same reason lol

Milen Todev's profile picture
Milen Todev11 months ago

yeah.. we have to spam layout change to keep using our native languages

Christopher / クリス's profile picture
Christopher / クリス11 months ago

Couldn't we fix this via terminal emulators (and i think some do? Havent written TUIs in a while)? Although getting all terminal emulators to support that new protocol would also be a big pain

azeke's profile picture
azeke11 months ago

bigger problem is that modal editors use [], ctrl+Letter and shift+Letter to begin with, how's that different from normie VS Code F4 I'm of half mind to dedicate time to remap Helix bindings for my 34-key latin-colemak+3 other different languages and stuff like this blocks me

Diego's profile picture
Diego11 months ago

No, the problem is the terminal. It's not an editor issue.

Dmitry Suzdalev's profile picture
Dmitry Suzdalev11 months ago

How would you do that in gui emacs? If I press "M-b" in ru layout, it still interprets it as "M-и" and fails to execute the command. I know that there's an option to switch the layout from within emacs, but that makes for 2 ways of switching: DE and emacs, meh.

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

Emacs doesn't handle it because it's old and bad, not because it inherently can't, so it's kind of special haha :) Its workaround is to switch layouts inside if emacs, M-x set-input-method

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

I guess they just historically didn't do it and nobody bothered implementing it after emacs became a gui program. Or maybe for backwards compatibility, idk

Dmitry Suzdalev's profile picture
Dmitry Suzdalev11 months ago

Yeah, maybe it's something like that. But at least it's possible!

Quiveron's profile picture
Quiveron11 months ago

Good video

SimpleCoffee's profile picture
SimpleCoffee11 months ago

I'm surprised no one made an updated protocol for terminals with better UI support. the VT standard should be updated for modern day. Perhaps with some client side scripting for better responses. Maybe asm-html, just the bare bones everything else can be built with scripting.

Victor Hugo's profile picture
Victor Hugo11 months ago

Wouldn't a set of alias + the keymap solve the issue? I know it is not optimal, but no piece of software is perfect out of the box and always needs some config effort

KDev's profile picture
KDev11 months ago

Works for me.

gordo's profile picture
gordo11 months ago

i've been thinking about this ever since i watched it. how is the russian in your example using the terminal CLI at all? they certainly `cd` around, pipe programs, write some awk, etc. -- all ascii -- where they would have problems long before vim.

Railander's profile picture
Railander11 months ago

would it still be a problem with something with mouse support?

Brian Spragge's profile picture
Brian Spragge11 months ago

Is it because your terminal is set to Russian, and is it possible to terminal source a different language from within nvim, so that the terminal language changes and not necessarily the nvim language? That way, the terminal is expecting english and allows movement and <ctrl+[>.

Mastergrill's profile picture
Mastergrill11 months ago

I'm interested in knowing how this issue could be solved. I'm curious to know if the physical keybinds can be passed through the terminal emulator directly to the terminal application.

Nuri Yuri (SP.QR)'s profile picture
Nuri Yuri (SP.QR)11 months ago

I'm not sure about this whole physical key stuff. I have french keyboard, the [ is on 5 and the ] is on the key after 0. I'd need to know where [ and ] are on qwerty to type them and get them act like it should.

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

The point is that if you knew physical key locations you wouldn't care about [ or ] - you would just know that it's that key in the top-right somewhere

Nuri Yuri (SP.QR)'s profile picture
Nuri Yuri (SP.QR)11 months ago

Yes of course, but for that we need the UI to show the virtual key from the keyboard because I wouldn't know that I have to press $ instead of ] ^^

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

This is not a problem to implement... Unless the program runs in a terminal, which circles back to the topic of my video :D

FallenOne's profile picture
FallenOne11 months ago

seems like all the terminal emulator devs could band together and make a standardized "extension" that allows direct crossplatform keymap reading

Valentin Ignatev's profile picture
Valentin Ignatev11 months ago

There is kitty keyboard protocol, but it's not that good, and also adoption is, well, you know

FallenOne's profile picture
FallenOne11 months ago

I've had these problems you mentioned in the past, but my current approach (I speak croatian, basically latin english but with additional "č, ć, dž, đ, lj, nj, š, and ž" letters, what works is the "Linux Compose Key", and here is the cheatsheet:

FallenOne's profile picture
FallenOne11 months ago

I don't think it works with cyrillic, but with compose key I can just hold alt, type " c' ", and get "ć"

Lolleka's profile picture
Lolleka11 months ago

No. Terminal emulators and terminal text editors will forever be peak.

Related Videos

Islamists are not on the same evolutionary branch.
0:29

Sensitive content

Islamists are not on the same evolutionary branch.

Ryan Williams

148,980 views • 7 months ago