hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Alt issues

Open rauchg opened this issue 10 years ago • 43 comments

To continue the now closed PR https://github.com/zeit/hyperterm/pull/201 We might have introduced a regression with alt handling.

On german layout, ~ doesnt show up for alt/opt + n. i can hack it there while typing alt + shift + n and deleting the unicodes before the ~.

cc @patrickhaug @marcbachmann @teemuteemu

rauchg avatar Jul 17 '16 21:07 rauchg

another alt behaviour still not resolved is alt + arrow to move between word boundaries

nfcampos avatar Jul 17 '16 21:07 nfcampos

Umlauts are also still a problem. (alt + u (¨) + u, on US keyboard) Here's how iTerm handles them. I have no idea how hterm manages to swallow those inputs. umlauts

marcbachmann avatar Jul 17 '16 22:07 marcbachmann

@marcbachmann can you check if #214 fixes that for you?

nfcampos avatar Jul 17 '16 23:07 nfcampos

I use alt + ñ to get: ~ but that not work I'm latin american, so I use the letter Ñ to get ~

luiscobot avatar Jul 18 '16 01:07 luiscobot

I can confirm that ALT + n on a german keyboard doesn't work to insert ~. Typing Umlauts directly (in this case ü) ends in this:

screen shot 2016-07-18 at 09 02 43

mxstbr avatar Jul 18 '16 07:07 mxstbr

Same issue with finnish keyboard layout and tildes, where ~ comes from alt+¨ (the key with ^ as shift+key).

petetnt avatar Jul 18 '16 07:07 petetnt

Broke alt+ behavior for ;, h, j, k, z for me, so I reinstalled 0.5.0. Would be very good if rolling back an update was as seamless as installing one

micimize avatar Jul 18 '16 10:07 micimize

Broke alt+ behavior for ;, h, j, k, z for me, so I reinstalled 0.5.0. Would be very good if rolling back an update was as seamless as installing one

What's the expected behavior?

marcbachmann avatar Jul 18 '16 10:07 marcbachmann

@marcbachmann they're mapped to various commands in tmux. alt+; = command line, alt+hjkl = pane switching, and alt+z = prefix

micimize avatar Jul 18 '16 11:07 micimize

To elaborate, ~ wasn't working in 0.5 for me either, not sure about umlauts!

mxstbr avatar Jul 18 '16 12:07 mxstbr

I'd also like to add that alt+1 or any of the layout command variants (2-5 and space) for tmux are also not being registered.

umamialex avatar Jul 18 '16 15:07 umamialex

Same issue with spanish keyboard: alt + ñ != ~

Vistur avatar Jul 25 '16 06:07 Vistur

Same deal for Swedish & Danish layouts on early 2015 MBP's. alt does not want to play ball.

kasperlewau avatar Jul 28 '16 07:07 kasperlewau

having this in tmux config works fine in iTerm but not in Hyperterm:

# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D

deepsweet avatar Jul 28 '16 12:07 deepsweet

Same issue with french keyboard: alt + n != ~

This is a deal breaker for me :/

(in version 0.7.1)

benoitzohar avatar Jul 29 '16 07:07 benoitzohar

I think part of the problem has to do with how legacy terminals were implemented, and what capabilities a modern terminal emulator needs to... well, emulate. 😛

As mentioned in the XTerm Control Sequences documentation, the "Alt" key is often used to emulate the "Meta" key that is missing from most modern machines.

One big reason for terminals not to interpret Alt+character sequences as alternate characters (AltGr behavior) is so that keyboard shortcuts using the Alt key can be bound in terminal programs. (see this article on the Vim wiki for several examples, and more information on the problem) On the other hand, that makes things more difficult for international users who rely on the ability to type certain characters with AltGr-style behavior.

If you're interested, I've collected some (currently rather incomplete) information about how various terminals handle different key combinations, and shared it in this spreadsheet. I'm planning on moving the data into a database, and having a terminal program that will ask the user to press certain keys in order to fill out information for different terminals.


It seems to me that the most sensible route for a terminal app to take is to provide user-configurable key bindings. (I've already wanted this in hyperterm, since I'm primarily a PC user, but now having to work in Mac OS X is driving my muscle memory insane; I'd really like to remap some of the standard bindings hyperterm provides) I started working on a plugin to allow this, but so far I haven't had much luck even duplicating the built-in keybindings. If I get it working, I'll push it to GitHub and announce it here.

whitelynx avatar Aug 19 '16 01:08 whitelynx

I tend to use alt+b to navigate backwards between words, which in HyperTerm produces a funky ∫ character. I had the same issue when configuring iTerm, which was solved thanks to the option to map alt to +Esc. Would love to see that option in HyperTerm!

beane avatar Aug 31 '16 04:08 beane

Update: Just discovered how to bind Alt-b and Alt-d on OS X (and probably other Linux machines as well).

I added the following lines to my ~/.inputrc:

# `Alt-b` to nav back a word
"\xe2\x88\xab":"\eb"
# `Alt-d` to deleted back a word
"\xe2\x88\x82":"\ed"

You can also write

$ bind '"\xe2\x88\xab"':'"\eb"'
$ bind '"\xe2\x88\x82"':'"\ed"'

to temporarily have those bindings in any given session.

I think this will probably work on any terminal you're using, which is kind of cool, but it would still would be awesome to have a configurable option in HypterTerm!

Sources:

Helpful SO answer. Script for finding what characters you need for binding from a surprisingly useful random 2005 internet page.

beane avatar Aug 31 '16 05:08 beane

@beane That will work for bash, but not for some other shells or terminal apps. For instance, in fish, you'd have to use its bind command (which has a different syntax than readline's bind), and in Vim, you'd probably want to use CTRL-V in insert mode to get the right bindings. Screen and tmux (and therefore Byobu) use the bind-key command in their configs.

It'd still be easiest if HyperTerm had a way to configure its keybindings so we could set it up to produce keycodes that are expected by most terminal apps, instead of having to configure each one separately.

whitelynx avatar Sep 11 '16 16:09 whitelynx

I have alt + shift + left/right mapped to switch windows in tmux, and this doesn't work in Hyperterm (but does in Terminal.app and iTerm). alt + left/right to move between words does work though, so it's the shift modifier that breaks it.

@whitelynx +1 for configurable keybindings. Will resolve a lot of these issues fairly easily.

molovo avatar Sep 26 '16 20:09 molovo