Repository: qutebrowser/qutebrowser

Issue:
Document <unbound> in keys.conf.
```
set-cmd-text -s :open -t
    t
```

Has a one second (or so) delay before opening the command line (to type in the URL). So obviously I think this is due to the timeout for the `timeout` or `partial-timeout` option. Because with:

```
set-cmd-text -s :open -t
    o
```

it opens instantaneously. However, I don't have any other keybindings that start with `t`, so shouldn't binding it to `t` also open instantaneously?

The full keys.conf: https://github.com/vyp/ui/blob/bca9e8640a743b8189f332d04d8660e0eb241f5b/qutebrowser/.config/qutebrowser/keys.conf#L48-L55

(An easy way to search for bindings that start with `t` is to search for `____t` (underscores signify spaces) because all the keybindings lines have 4 spaces at the start.)

``` shell
$ qutebrowser --version
qutebrowser v0.4.1
Git commit:

CPython: 3.4.3
Qt. 5.4.2, runtime: 5.4.2
PyQt: 5.4.2
```

I have a feeling this is due to something incredibly simple which I have managed to miss somehow, but I cannot figure out what. So to avoid wasting your time, you should maybe first try to reproduce it (to confirm that it isn't a bug or something).



Discussion:
This also happens with the following bindings even though I have no other `s`/`S` bindings:

```
set-cmd-text -s :open google
    s

set-cmd-text -s :open -t google
    S
```

I'm definitely missing something here..

The way `keys.conf` currently works is that the default keybindings are _always_ bound, and you'll need to explicitly unbind them.

This will probably be changed (or at least configurable) as part of #499.

So you'll need to add something like:

```
<unbound>
    th
    tl
    t
    sf
    ss
    sl
    sk
    Ss
```

Thanks! I don't think this is documented is it? (except for in the changelog a bit)

Should I put `<unbound>` at the beginning or end of a keymode section? (I'm thinking beginning..)

Btw, I know I'm going to try for myselfTM, but I cannot try it right now, so just asking for confirmation before I get the chance.

Huh, you're right - reopening this. I think it doesn't matter where you put it.

Also, using a literal space as part of a binding _does_ work, however the bindings have a delay that seems as though cannot be fixed via `<unbound>`.

For example, say I have:

```
set-cmd-text -s :open google
     g
```

which is five spaces followed by a `g`, then doing:

```
<unbound>

```

which is just five spaces on the line below `<unbound>` there. The `<Space>g` binding still gets a delay. Do you think this could be because space for whatever reason is sort of ignored when determining if there should be a delay? For example, I _do_ have the default:

```
scroll-perc 0
    gg
```

binding in my keys.conf. So maybe when pressing `<Space>g`, it only sees the `g` and considers it the first key typed as part of a keybinding, and because of this `gg` binding, it's waiting to see if another `g` is pressed, and then when it isn't, it suddenly recognises the first `<Space>` and therefore runs `set-cmd-text -s :open google`...

Btw I am still only on qutebrowser v0.4.1, so you should try to reproduce this first. I admit that this isn't exactly the same as the original issue here, should a new issue be created?

@vyp can you please open a separate issue? I haven't had time to look at it yet, but then it isn't lost somewhere deep in this thread at least :wink:


Resolving patch:
diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py
--- a/qutebrowser/config/configdata.py
+++ b/qutebrowser/config/configdata.py
@@ -1221,6 +1221,14 @@ def data(readonly=False):
 # with Shift. For special keys (with `<>`-signs), you need to explicitly add
 # `Shift-` to match a key pressed with shift.  You can bind multiple commands
 # by separating them with `;;`.
+#
+# Note that default keybindings are always bound, and need to be explicitly
+# unbound if you wish to remove them:
+#
+# <unbound>
+#   keychain
+#   keychain2
+#   ...
 """
 
 KEY_SECTION_DESC = {


Test patch: