I’ve been using linux, mostly arch, for a very long time and decided to try out ArchLabs yesterday and I’m really happy with how it’s set up. I’m running the i3 variant.
However this thing is driving me crazy and I can’t find a good way to fix it. As an AL newbie I’d rather not fiddle with too many config files before I get accustomed to how things work here since I might end up overriding some settings elsewhere.
But this is something I need to have working right away…so. How do I get my setup to behave like gnome-terminal for example? By default when I press ctrl-left i go back one word and pressing the end key takes me to the end of the line in most terminals and setups.
Why on earth do I run into this issue with my current setup? I’d really appreciate a simple explanation on why URxvt has decided to be not like the others? It just feels so ridiculous but there must be a valid reason.
So what’s the right way (on AL particularily) to set this up so that I can open a terminal and have all these keys do what they’re supposed to do? TBH I’m not even sure if this is a zsh or URxvt issue or maybe something else.
So sorry for venting but this thing triggers me much more than it should.
Yea urxvt has some issues. It is much older than most terminals and certainly than vte based ones (like gnome-terminal) so it has many reasons for the way it is, an excerpt from wikipedia
Aside from features such as those controlled by resource files, rxvt’ s terminal emulation differs from xterm in two important ways:
It emulates a VT102, rather than a VT220. That means that it handles 8-bit data differently, does not implement the C1 controls that xterm does. xterm des implement a switch “-k8”[3] to suppress that functionality; rxvt does not provide an option to emulate a VT220.
The strings sent for function keys are different. xterm sends strings that are encoded using the same rules as the ANSI/ISO escape sequences. Rxvt’ s do not, though they provide comparable flexibility in this area.
The rxvt distribution also includes an analog clock program called rclock. Very old distributions included a copy of vttest, but dropped that in 1996 with version 2.18.
You’ve got a few possible solutions
Create a shell bind for the key sequence. Using <Ctrl-v> then pressing the key sequence will let you see the actual sequence output from the terminal. eg. <Ctrl-Left> in my terminal is ^[[1;5D. This can then be bound to an action using zsh’s bindkey, eg. to get the ctrl-left jumping back words
bindkey '^[[1;5D' backward-word
Use rxvt’s built in settings to do nearly the same as above but in ~/.Xresources instead of shell config, see here for exactly what you want in an example.
Install a vte based terminal emulator instead like gnome-terminal, termite, xfce4-terminal, etc…
You can also check out ~/.zsh/** for the default AL zsh stuff, some good examples in there as well.
this also strikes me as off, check /etc/locale.gen make sure your language of preference is uncommented and that en_US.UTF-8 is as well, then run locale-gen as root.
I want English language everywhere & a Finnish keyboard layout with functioning home/end/delete keys and others for easier command line editing, such as Ctrl-left
en_US.UTF-8 is the only uncommented locale. I did run locale-gen again to be sure (no effect).
So if you open whichever terminal you’re using and type <Ctrl-v> then enter the key sequence you want to use, paste what it outputs here for each with what action you want and I’ll post some bind commands.
Unless you think this issue is unrelated and locale based, I just haven’t seen any reason to think so. If you’re having issues in other applications as well then it would be different.
Let me show you what I use personally with st, as there really is no clear cut way to handle terminal escape sequences across all cases.
Also of note is that not all terminals will support terminfo either, it just so happens that mine does. If I don’t bind some of these then the sequences aren’t interpreted correctly and you get some funny behaviour, like insert deleting some characters and inserting a ~, etc…
Thanks. Since .zsh/settings/bindings.zsh already has relevant entries I’m not sure why this problem still persists. I’d like to find the root cause and stick to the defaults as much as possible.
Home-key: ^[OH
Left-key: ^[OD
Etc.
I actually had to install Windows today just to update my Thinkpad Pro Dock firmware so I decided to reinstall AL, just with fewer packages. I use Termite exclusively now since it does everything I need.
Thanks again, I appreciate your help a lot, this is quite confusing!
Sorry <Ctrl-Arrow>(among others) are non-standard sequences in the terminfo spec.
Regarding the above bindings (not ctrl-*, but the home, end, delete), did you first autoload -U terminfo before trying to use ${terminfo[XXX]}, termite does have a terminfo entry, so the defaults provided in bindings.zsh or my above example should work for those keys.
pacman -S termite-terminfo
You can examine the terminfo entry for your terminal with infocmp -x and you will either just have to know the name of the entry or compare the sequences, see man terminfo in the Predefined Capabilities section.
Do they really not offer another flashing solution aside from installing another os? Not a harp on windows at all, just usually with firmware they make it available to most os’
Hah, nope! But there’s this ongoing project that might change things for the future: https://fwupd.org/
And just downloading the firmware .exe wasn’t enough, it errored out several times for various reasons so I had to install the Lenovo update tool, download and install every driver, reboot several times and only then would the firmware be updated correctly. But now it’s done and my external display seems to work as it should.
infocmp just parses the compiled database for the current terminal and prints it out, it’s perfectly fine to have many entries on the same line. The \E is the escape character ^[(it’s all one character but the browser makes it into printable ^ and [) you can also freely use the escape in binds and the shell will translate it, so \E[2~ and ^[[2~ are the same thing.
I’m honestly not sure why it would need anything else on your side other than the Ctrl binds. I’ll do a bit of looking around.
After installing termite and fiddling with it for a bit it seems to work fine on my end (very strange) some of the sequences differ but that shouldn’t matter, all the binds (insert, home, etc…) are working, essentially after this I’m no less confused