Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

Terminal text editors are an evolutionary dead-end

67,839 Aufrufe • vor 11 Monaten •via X (Twitter)

60 Kommentare

Profilbild von HSVSphere
HSVSpherevor 11 Monaten

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

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

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.

Profilbild von HSVSphere
HSVSpherevor 11 Monaten

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.

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

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

Profilbild von HSVSphere
HSVSpherevor 11 Monaten

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

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

Damn it works much better with youtube thumbnail

Profilbild von Chris McGee
Chris McGeevor 11 Monaten

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.

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

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.

Profilbild von Chris McGee
Chris McGeevor 11 Monaten

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.

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

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

Profilbild von Chris McGee
Chris McGeevor 11 Monaten

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.

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

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

Profilbild von Pepe Aoriano
Pepe Aorianovor 11 Monaten

“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

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

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

Profilbild von Aram Hăvărneanu
Aram Hăvărneanuvor 11 Monaten

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.

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

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

Profilbild von Ereechepeine Veeph
Ereechepeine Veephvor 11 Monaten

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

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

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

Profilbild von Ereechepeine Veeph
Ereechepeine Veephvor 11 Monaten

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

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

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

Profilbild von Ereechepeine Veeph
Ereechepeine Veephvor 11 Monaten

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

Profilbild von Olex (Solo gamedev Diablo-like) 🇺🇸🇺🇦
Olex (Solo gamedev Diablo-like) 🇺🇸🇺🇦vor 11 Monaten

Just like chopsticks and non-alphabet languages. :P

Profilbild von Omar Mahdi
Omar Mahdivor 11 Monaten

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 💀.

Profilbild von Caleb Maclennan
Caleb Maclennanvor 11 Monaten

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:

Profilbild von Petr Skocik
Petr Skocikvor 11 Monaten

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.

Profilbild von Jesse S
Jesse Svor 11 Monaten

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)

Profilbild von Franek Kopara
Franek Koparavor 11 Monaten

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

Profilbild von Deus Lemmus『旅鼠神』
Deus Lemmus『旅鼠神』vor 11 Monaten

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

Profilbild von meatball
meatballvor 11 Monaten

i love vim and agree

Profilbild von Multiple Systems
Multiple Systemsvor 11 Monaten

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

Profilbild von MoiSoto 🪐
MoiSoto 🪐vor 11 Monaten

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.

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

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" :/

Profilbild von T. Vuorinen
T. Vuorinenvor 11 Monaten

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!

Profilbild von Milen Todev
Milen Todevvor 11 Monaten

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

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

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

Profilbild von Milen Todev
Milen Todevvor 11 Monaten

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

Profilbild von Christopher / クリス
Christopher / クリスvor 11 Monaten

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

Profilbild von azeke
azekevor 11 Monaten

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

Profilbild von Diego
Diegovor 11 Monaten

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

Profilbild von Dmitry Suzdalev
Dmitry Suzdalevvor 11 Monaten

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.

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

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

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

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

Profilbild von Dmitry Suzdalev
Dmitry Suzdalevvor 11 Monaten

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

Profilbild von Quiveron
Quiveronvor 11 Monaten

Good video

Profilbild von SimpleCoffee
SimpleCoffeevor 11 Monaten

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.

Profilbild von Victor Hugo
Victor Hugovor 11 Monaten

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

Profilbild von KDev
KDevvor 11 Monaten

Works for me.

Profilbild von gordo
gordovor 11 Monaten

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.

Profilbild von Railander
Railandervor 11 Monaten

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

Profilbild von Brian Spragge
Brian Spraggevor 11 Monaten

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+[>.

Profilbild von Mastergrill
Mastergrillvor 11 Monaten

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.

Profilbild von Nuri Yuri (SP.QR)
Nuri Yuri (SP.QR)vor 11 Monaten

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.

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

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

Profilbild von Nuri Yuri (SP.QR)
Nuri Yuri (SP.QR)vor 11 Monaten

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 ] ^^

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

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

Profilbild von FallenOne
FallenOnevor 11 Monaten

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

Profilbild von Valentin Ignatev
Valentin Ignatevvor 11 Monaten

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

Profilbild von FallenOne
FallenOnevor 11 Monaten

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:

Profilbild von FallenOne
FallenOnevor 11 Monaten

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

Profilbild von Lolleka
Lollekavor 11 Monaten

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

Ähnliche 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 Aufrufe • vor 7 Monaten