Skip to content

fix(cli): prevent false positive detection of amazon_q tool#80

Closed
ysjn wants to merge 1 commit intofolke:mainfrom
ysjn:fix-amazon-q-detection
Closed

fix(cli): prevent false positive detection of amazon_q tool#80
ysjn wants to merge 1 commit intofolke:mainfrom
ysjn:fix-amazon-q-detection

Conversation

@ysjn
Copy link
Copy Markdown

@ysjn ysjn commented Oct 8, 2025

Description

When calling .select({ filter = { installed = true } }) the amazon_q tool appears in the selection list even though the q command is not actually installed on the system.
This occurs despite the installed = true filter being applied, which should only show tools that are genuinely installed.

Root Cause

The issue stems from how sidekick.nvim detects running processes to determine if a tool is "installed":

The amazon_q tool configuration uses is_proc = "\\<q\\>" to detect running processes.
This regex pattern matches word-bounded q characters.

When used with fzf-lua plugin (I'm using LazyVim 👍) generates fzf commands with placeholder patterns like {q}, {+}, and {n} for dynamic query substitution.
The q character inside {q} is treated as word-bounded and matches the \\<q\\> regex pattern.

Since sidekick detects the fzf process as an "amazon_q" process, it creates a session state with installed = true, causing the tool to pass through the { installed = true } filter.

Proposed Solution

Use more specific regex pattern:
Current: is_proc = "\\<q\\>"
Proposed: is_proc = "^b$"

Testing

The fix can be verified by:

  1. Ensuring vim.fn.executable('q') returns 0 (not installed)
  2. Running fzf-lua commands that generate {q} placeholders
  3. Calling require("sidekick.cli").select({ filter = { installed = true } })
  4. Confirming amazon_q no longer appears in the filtered list

Related Issue(s)

n/a

Screenshots

*claudecode codex-cli is installed on my machine.
CleanShot 2025-10-08 at 23 16 34
CleanShot 2025-10-08 at 23 17 00

Note: I'm relatively new to Lua, so please let me know if there's a more idiomatic way to handle this or if I've missed any edge cases.

@folke folke closed this in 4b65b8a Oct 8, 2025
@ysjn
Copy link
Copy Markdown
Author

ysjn commented Oct 10, 2025

tysm for quick fix! 🚀
(Sorry I should've filed a issue first instead of jumping to PR.)

folke pushed a commit that referenced this pull request Oct 17, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.0.0](v1.3.0...v2.0.0)
(2025-10-17)


### ⚠ BREAKING CHANGES

* **config:** changed the default keymaps. Please check the updated
documentation and example mappings

### Features

* **cli.claude:** transform line ranges to a format Claude can
understand. Closes
[#59](#59)
([4a492da](4a492da))
* **cli.select:** better distinction between attaching to
terminal/external
([48d0bf6](48d0bf6))
* **cli:** `close()` on an external session, now detaches from that
session. Closes [#98](#98)
([d2e6c64](d2e6c64))
* **cli:** added `<c-q>` to hide in normal mode, so from terminal double
`<c-q>` will hide
([358804c](358804c))
* **cli:** added health checks and optional reqs to the docs for `lsof`
and `ps`. Fixes [#89](#89)
([d403ec3](d403ec3))
* **cli:** added some config option validation
([c236b38](c236b38))
* **cli:** added terminal navigation with `<c-hjkl>`. Only mapped when
not a float and a window in the dir exists. See
[#51](#51)
([b48e177](b48e177))
* **cli:** deduplicate cli tool sessions. Closes
[#92](#92)
([e5bcf17](e5bcf17))
* **cli:** handle special filenames for Claude, Gemini, Qwen. Fixes
[#130](#130)
([19b5985](19b5985))
* **config:** changed the default keymaps. Please check the updated
documentation and example mappings
([6608705](6608705))
* **context:** you can now use context fallbacks like `{function|line}`
([076147a](076147a))
* **copilot:** allow configuring minimum level for copilot LSP messages
([4b6750b](4b6750b))
* **opencode:** add pid to external opencode sessions
([3d9d519](3d9d519))
* **terminal:** much better scrollback buffer. no flickering and should
work in all modes
([3aa2fe5](3aa2fe5))
* **terminal:** restore normal/terminal mode when entering the sidekick
window
([50c40d5](50c40d5))
* **terminal:** switch to scrollback when doing mouse scroll
([0dd3c3b](0dd3c3b))
* **tmux:** entering normal mode in a tmux terminal, now loads the whole
tmux scrollback
([a453f76](a453f76))
* **tmux:** some tools won't process input if they don't have focus, so
tools can now set `mux_focus = true`
([41dec4d](41dec4d))
* **tool:** tools can now further format text before it's sent. See
[#130](#130), see
[#59](#59)
([28f8a07](28f8a07))
* **util:** weak ref util method
([8036aea](8036aea))


### Bug Fixes

* **cli.prompt:** proper way of rendering templates with highlights
([30b7b9e](30b7b9e))
* **cli.select:** sort terminal sessions before external sessions
([c487d53](c487d53))
* **cli.state:** allow creating new sessions for tools that have only
external sessions
([c588efb](c588efb))
* **cli:** allow sending a newlline `msg="\n"`
([fc0067a](fc0067a))
* **cli:** don't send empty messages
([63f626c](63f626c))
* **location:** different format that should work for most cli tools.
Closes [#59](#59)
([d570e1f](d570e1f))
* **nes:** added triggerKind. Maybe that's needed for nes?
([e535808](e535808))
* **nes:** better didFocus tracking
([3669eae](3669eae))
* **nes:** don't clear NES on `TextChanged` or `BufWritePre`. Closes
[#91](#91)
([32fa55c](32fa55c))
* **nes:** don't process unloaded buffers. Closes
[#86](#86)
([620adf0](620adf0))
* **nes:** exec nes commands AFTER edits have been applied
([80d1604](80d1604))
* **nes:** skip old edits early
([8395007](8395007))
* **nes:** textDocument/didFocus
([b7085d7](b7085d7))
* **nes:** trigger on `ModeChanged *:n` instead of `InsertLeave`. See
[#125](#125)
([abbd051](abbd051))
* **opencode:** check that open server is actually from an opencode
process. Closes [#87](#87)
([cb8485a](cb8485a))
* **procs:** handle case where `USER` is not set. Closes
[#82](#82)
([01f89b7](01f89b7))
* **q:** filer procs on qchat instead of `q`, which seems to be the
actual binary. Closes
[#80](#80)
([4b65b8a](4b65b8a))
* **qwen:** set `mux_focus = true` since qwen doesnt process input if
unfocused. Fixes
[#104](#104)
([c262b25](c262b25))
* **sessions:** load tools during session setup, since thet may register
session backends (like opencode)
([c7761eb](c7761eb))
* **status:** always return `nil` when copilot status is disabled in
config
([f908fec](f908fec))
* **terminal:** allow auto split width/height
([#111](#111))
([03cf9fb](03cf9fb))
* **terminal:** better handling of crlf for send. See
[#119](#119)
([7185e08](7185e08))
* **terminal:** blur on hide
([81b2a85](81b2a85))
* **terminal:** cleanup scrollback buffer
([9ef38db](9ef38db))
* **terminal:** don't error when it's the last window and hiding. Closes
[#124](#124)
([cab3ec4](cab3ec4))
* **terminal:** keymap rhs fallback to rhs string
([2b644f0](2b644f0))
* **terminal:** no need to check for mouse scroll when we're not in
terminal mode
([b52c3be](b52c3be))
* **terminal:** only show scrollback when entering normal mode and the
terminal window is current. Closes
[#106](#106)
([1e03666](1e03666))
* **terminal:** remove padding since it causes issues with terminal
reflow (Neovim bug)
([cc32068](cc32068))
* **terminal:** safer way of entering terminal mode from scrollback
buffer ([#129](#129))
([2195213](2195213))
* **terminal:** safer way of entering terminal mode from scrollback
buffer. Closes [#103](#103)
([0bc6f88](0bc6f88))
* **terminal:** scroll to last line in normal mode. Closes
[#101](#101)
([69eb7b7](69eb7b7))
* **terminal:** send all text in one chunk with nvim_paste. Fixes
[#119](#119). Fixes
[#118](#118)
([ca97ecd](ca97ecd))
* **terminal:** use `nvim_paste` instead of `nvim_chan_send` to better
simulate user input. Closes
[#110](#110)
([cebcd44](cebcd44))
* **terminal:** use nvim_put directly to paste into the terminal
([bed1d65](bed1d65))
* **text:** handle empty virtual lines
([98a33eb](98a33eb))
* **tmux:** use `paste-buffer` with the `-r` flag to preserve newlines.
Fixes [#93](#93)
([2fdc4d4](2fdc4d4))
* **zellij:** attach to existing isolated session
([9deb771](9deb771))
* **zellij:** zellij:create -&gt; zellij:start
([4bd0df2](4bd0df2))


### Performance Improvements

* **nes:** only send didFocus events for regular buffers and if
different
([39a1638](39a1638))
* **terminal:** only load scrollback buffer when needed
([628c3d0](628c3d0))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant