aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-server-postgres
diff options
context:
space:
mode:
authorAlex Kirk <akirk@users.noreply.github.com>2026-03-19 23:22:48 +0100
committerGitHub <noreply@github.com>2026-03-19 22:22:48 +0000
commit4f1402001b3c0e8df61a4a327a9ec02691096beb (patch)
treef569353e289062370ee2fac4c5712dcef07c6493 /crates/atuin-server-postgres
parentfix: Call ensure_hub_session even if primary sync endpoint is self-hosted (#3... (diff)
downloadatuin-4f1402001b3c0e8df61a4a327a9ec02691096beb.zip
fix(ai): restore url-quote-magic for ? in zsh (#3304)
I discovered that since #3178, typing or pasting a `?` in a URL no longer gets escaped by `url-quote-magic`. For example, pasting `https://example.com/search?q=foo&test` would result in `https://example.com/search?q=foo\&test` (leave the `?` unescaped, while `&` still worked correctly). The root cause is that Atuin binds `?` to `_atuin_ai_question_mark`, which bypasses `url-quote-magic` in two ways: 1. **Typed `?`**: the else branch (non-empty buffer) appended `?` directly to `LBUFFER` instead of delegating to `self-insert` which runs `url-quote-magic`. 2. **Pasted `?`**: `bracketed-paste-magic` only [activates widgets whose name matches `self-*`](https://github.com/zsh-users/zsh/blob/99f578897614f318cdad76402a7d2423ce176b5a/Functions/Zle/bracketed-paste-magic#L24). Since `_atuin_ai_question_mark` didn't match, pasted `?` characters fell through to `zle .self-insert` — the raw built-in that inserts literally without any URL escaping. The fix renames the widget to `self-atuin-ai-question-mark` (Note: I am not sure this is the best way but it is a relatively simple one). The `self-` prefix satisfies `bracketed-paste-magic`'s `active-widgets` pattern, so `?` in paste is processed by our widget and delegated to `zle self-insert`, restoring `url-quote-magic` behaviour. The typed case delegates to `zle self-insert` in the else branch for the same reason.
Diffstat (limited to 'crates/atuin-server-postgres')
0 files changed, 0 insertions, 0 deletions