Vimium: Pinning tab <a-p> seems to be broken in the latest release

Created on 13 Jun 2016  路  20Comments  路  Source: philc/vimium

It used to work, somehow stopped (?)

Most helpful comment

Just tried it. It's weird but, as a workaround, I can enter <alt-p> on the keyboard to type a (Pi) sign after the map command, and the shortcut would work as expected (I'm on Mac OS, Chrome 51)

For example:

unmap <a-p>
map 蟺 togglePinTab

All 20 comments

It doesn't work for me as well.

I cannot pin tabs in Google Chrome on OS X. It works in Chromium on Linux though.

@agzam, @0mp... Could you go here, hit Alt-p and report back the result, please. Disable Vimium on that page first, of course.

Edit... I'm particularly interested in what you're seeing for keyIdentifier and key (the last two columns).

I just entered the webpage and hit alt-p. This is what I got:

| evt: | which: | keyCode: | charCode: | modifier: | keyIdentifier: | key: |
| --- | --- | --- | --- | --- | --- | --- |
| keyup | 80 | 80 | 0 | alt | undefined | 幕 |
| keypress | 315 | 315 | 315 | alt | undefined | 幕 |
| keydown | 80 | 80 | 0 | alt | undefined | 幕 |
| keydown | 18 | 18 | 0 | alt | undefined | Alt |

@0mp ... thanks! That's helpful. This is looking like the same as #2147.

I'm assuming you're using Vimium 1.56:

  • What Chrome versions (Mac and Linux)?
  • Is the keyIdentifier property defined when you try the test page on Linux (I'm guessing yes)?

@smblott-github.

I use Vimium 1.56 on both machines.

Linux (BunsenLabs Hydrogen 32-bit)

  • Chromium
  • Version 51.0.2704.79 Built on 8.4, running on Debian 8.5

| evt: | which: | keyCode: | charCode: | modifier: | keyIdentifier: | key: |
| --- | --- | --- | --- | --- | --- | --- |
| keyup | 18 | 18 | 0 | undefined | Alt | Alt |
| keydown | 18 | 18 | 0 | alt | undefined | Alt |

OS X

  • Google Chrome
  • Version 51.0.2704.84 (64-bit)

| evt: | which: | keyCode: | charCode: | modifier: | keyIdentifier: | key: |
| --- | --- | --- | --- | --- | --- | --- |
| keyup | 18 | 18 | 0 | undefined | Alt | Alt |
| keyup | 80 | 80 | 0 | alt | undefined | 幕 |
| keypress | 315 | 315 | 315 | alt | undefined | 幕 |
| keydown | 80 | 80 | 0 | alt | undefined | 幕 |
| keydown | 18 | 18 | 0 | alt | undefined | Alt |

Here's what I get...

snapshot

(Chrome 51.0.2704.63, Debian). Here, Vimium uses the second keydown event (reading bottom to top), and uses the keyIdentifier property. In your case, @0mp, Vimium would use the key property. However, there seems to be issues with Chromium's .key implementation; see #2147. I suspect that's what you're seeing, in which case it's a Chromium bug.

Any suggested work-around?

Yes, a work around would be good, pinning tabs from the keyboard is super handy :)

I don't use that binding myself (I find it clunky). I prefer:

unmap <a-p>
map gp togglePinTab

@smblott-github that works, I'll go with that for now, thanks!

@smblott-github that is beautiful. Thank you for the suggestion.

Just tried it. It's weird but, as a workaround, I can enter <alt-p> on the keyboard to type a (Pi) sign after the map command, and the shortcut would work as expected (I'm on Mac OS, Chrome 51)

For example:

unmap <a-p>
map 蟺 togglePinTab

Related to #2169

I have the workaround in my config, but recently something must have changed as it does not work anymore.

Chrome: Version 61.0.3163.91 (Official Build) (64-bit)
Vimium: 1.60.3

Custom mapping:

unmap <a-p>
map 蟺 togglePinTab

Has the problem come back for anyone else as well, or is it just me?

Yeah, just tried and I can't use those shortcuts anymore.

@Nesze

unmap <a-p>
map gp togglePinTab

still works for me

@nesze We've moved to a new key handling method now Chrome is depreciating the old one. It's generally much better, but it doesn't tell us which modifier keys do or don't contribute to the resulting character, so we can't distinguish eg. pressing alt and a key from pressing a combo including alt that generates .

Does the binding work if you explicitly include the modifiers you have to press (presumably <a-蟺>)?

@smblott-github do you think it would be worth including a different notation for using en_US for a single binding (eg. <@a-p>), now you've built support for it? This would certainly remove a lot of friction for users of different keyboard layouts if we used them for the default binding.

(I'm more than happy to work on this is it's of interest.)

@mrmr1993 I can confirm that setting the mapping key to <a-蟺> does the fix. Thank you!

Edit: in case of somebody is looking for a direct copy-paste:

unmap <a-p>
map <a-蟺> togglePinTab

@smblott-github do you think it would be worth including a different notation for using en_US...

Not too keen on that, myself. It could add complexity for little gain.

Was this page helpful?
0 / 5 - 0 ratings