Skip to content

Update tmux-cheatsheet extension - #26379

Merged
raycastbot merged 3 commits into
raycast:mainfrom
spencer-michaels:ext/tmux-cheatsheet
Apr 1, 2026
Merged

raycastbot merged 3 commits into
raycast:mainfrom
spencer-michaels:ext/tmux-cheatsheet

Conversation

@spencer-michaels

@spencer-michaels spencer-michaels commented Mar 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

Added a handful of features and small UI improvements I found useful for my own work in tmux.

  • Category filter dropdown — filter commands by category (Session, Window, Pane, etc.)
    • Grouped list view — commands organized by category with section headers when not searching
    • Custom keybinding detection — parses bind/bind-key lines from ~/.tmux.conf and shows your actual bindings instead of defaults
    • Auto-detected prefix — reads your tmux config to determine your prefix key (e.g. I use C-a instead of the default C-b, and the extension now reflects that). Defaults to ~/.tmux.conf but can be changed in the settings.
    • Pretty key symbols — displays C-a as ⌃A, arrow keys as ↑↓←→, M-x as ⌥X
    • Shortcut search — fuzzy search now includes shortcut keys (e.g. searching "z" finds toggle-zoom)
    • Paste to Terminal action — paste any command directly into the frontmost app
  • Fixed a typo in package.json ("acess" -> "access")

Screencast

Checklist

- feat: add category filter, keybinding detection, and key symbol
- feat: add category filter, keybinding detection, and key symbol
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: tmux-cheatsheet Issues related to the tmux-cheatsheet extension platform: macOS labels Mar 16, 2026
@raycastbot

raycastbot commented Mar 16, 2026 •

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

🔔 @alikhatibak you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

📋 Quick checkout commands
BRANCH="ext/tmux-cheatsheet"
FORK_URL="https://github.com/spencer-michaels/raycast-extensions.git"
EXTENSION_NAME="tmux-cheatsheet"
REPO_NAME="raycast-extensions"

git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.

@spencer-michaels
spencer-michaels marked this pull request as ready for review March 16, 2026 15:40
@greptile-apps

greptile-apps Bot commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR significantly enhances the tmux-cheatsheet extension with category filtering, grouped list view, custom keybinding detection from ~/.tmux.conf, auto-detected prefix key, pretty Unicode key symbols, fuzzy search on shortcuts, and a "Paste to Terminal" action. It also refactors the data model to separate shortcut info into a dedicated field.

  • Category filter dropdown and grouped sections improve navigation of the ~50 tmux commands
  • Custom keybinding/prefix detection reads user tmux config files (standard and XDG paths) to display personalized shortcuts
  • Pretty key formatting converts tmux notation (e.g., C-a) to Unicode symbols (e.g., ⌃A)
  • detectPrefix() is called on every re-render without memoization — should be wrapped in useMemo to avoid repeated synchronous file reads
  • getPreferenceValues uses a manually defined inline type instead of the auto-generated Preferences type

Confidence Score: 3/5

  • Functionally solid feature additions with a performance issue that should be addressed before merging.
  • The new features are well-implemented and the code is clean. The main concern is detectPrefix() performing synchronous file reads on every re-render, which will cause noticeable lag during search interactions. The inline preference type is a minor convention issue.
  • Pay close attention to extensions/tmux-cheatsheet/src/tmux-cheatsheet.tsx — the unmemoized detectPrefix() call on line 36 causes repeated synchronous disk reads on every re-render.

Important Files Changed

Filename Overview
extensions/tmux-cheatsheet/src/tmux-cheatsheet.tsx Major refactor adding category filtering, grouped list view, keybinding detection, and prefix auto-detection; detectPrefix() is called on every re-render instead of being memoized, causing repeated synchronous file reads.
extensions/tmux-cheatsheet/src/keybindingDetector.ts New file that parses tmux config bind/bind-key lines to detect custom keybindings; logic is well-structured with thorough edge case handling for flags, notes, and command normalization.
extensions/tmux-cheatsheet/src/prefixDetector.ts New file that reads tmux config to detect custom prefix; clean implementation, last-match-wins semantics match tmux behavior.
extensions/tmux-cheatsheet/src/tmuxConfig.ts New shared utility for reading tmux config files from standard locations (~/.tmux.conf and XDG config path); straightforward with proper error handling.
extensions/tmux-cheatsheet/src/formatKeys.ts New utility for converting tmux key notation to pretty Unicode symbols (e.g., C-a → ⌃A); handles modifiers, special keys, and base keys correctly.
extensions/tmux-cheatsheet/src/CommandDetail.tsx Updated to accept prefix prop and display prettified shortcuts in the detail view; added Paste to Terminal action.
extensions/tmux-cheatsheet/src/tmuxCommands.ts Added shortcut field to TmuxCommand interface and moved shortcut info from description strings to dedicated fields; cleaner data model.
extensions/tmux-cheatsheet/package.json Added textfield preference for prefix override, fixed typo, moved original author to contributors; categories and format are valid.
extensions/tmux-cheatsheet/CHANGELOG.md New changelog entry correctly uses {PR_MERGE_DATE} placeholder and is placed above the initial release entry.
extensions/tmux-cheatsheet/README.md Streamlined README reflecting new features; concise and well-organized.

Last reviewed commit: a49d4b7

Comment on lines +35 to +36
const prefixOverride = getPreferenceValues<{ prefix: string }>().prefix;
const prefix = prefixOverride || detectPrefix() || "C-b";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Synchronous file reads on every re-render

detectPrefix() performs synchronous readFileSync calls on ~/.tmux.conf and XDG config paths. Since it's called directly in the component body (not inside useMemo), it runs on every re-render — e.g., every keystroke in the search bar (after debounce) or dropdown change. This is the same pattern used for detectKeyBindings() which is correctly wrapped in useMemo on line 41.

Consider memoizing the prefix computation:

Suggested change
const prefixOverride = getPreferenceValues<{ prefix: string }>().prefix;
const prefix = prefixOverride || detectPrefix() || "C-b";
const prefixOverride = getPreferenceValues<Preferences>().prefix;
const prefix = useMemo(() => prefixOverride || detectPrefix() || "C-b", [prefixOverride]);

Rule Used: What: Don't manually define Preferences for `get... (source)

const { push } = useNavigation(); // Navigation hook to push details page
const [categoryFilter, setCategoryFilter] = useState(ALL_CATEGORIES);
const { push } = useNavigation();
const prefixOverride = getPreferenceValues<{ prefix: string }>().prefix;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use auto-generated Preferences type

getPreferenceValues should use the auto-generated Preferences type from raycast-env.d.ts rather than a manually defined inline type. Manual types can drift out of sync with the actual preference schema in package.json.

Suggested change
const prefixOverride = getPreferenceValues<{ prefix: string }>().prefix;
const prefixOverride = getPreferenceValues<Preferences>().prefix;

Rule Used: What: Don't manually define Preferences for `get... (source)

@0xdhrv 0xdhrv self-assigned this Mar 17, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

This pull request has been automatically marked as stale because it did not have any recent activity.

It will be closed if no further activity occurs in the next 7 days to keep our backlog clean 😊

@raycastbot raycastbot added the status: stalled Stalled due inactivity label Mar 31, 2026

@alikhatibak alikhatibak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great feature contributions, functionality greatly improved. Thank you so much @spencer-michaels !!

@raycast-extensions-bot raycast-extensions-bot Bot added the Approved Approved by a user label Apr 1, 2026
@raycastbot raycastbot removed the status: stalled Stalled due inactivity label Apr 1, 2026
- Changed type for getPreferenceValues to Preferences for better type safety.
- Wrapped prefix assignment in useMemo for performance optimization.

@0xdhrv 0xdhrv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, approved ✅

@raycastbot
raycastbot merged commit f6261fd into raycast:main Apr 1, 2026
2 checks passed
@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

ariesly15 pushed a commit to ariesly15/raycast-extensions that referenced this pull request Apr 2, 2026
- chore: 更新 delink 扩展的版本信息为初始发布版
- docs: 调整 delink 扩展快捷键说明顺序
- Merge branch \'raycast:main\' into main
- Update CODEOWNERs (2134dff)
- Update hetzner extension (raycast#26705)
- Update CODEOWNERs (840e5a9)
- Add ram-prices extension (raycast#26564)
- Update CODEOWNERs (45fad15)
- Add habitica-todos extension (raycast#26446)
- Update CODEOWNERs (3e686e1)
- Add Bundles extension (raycast#25680)
- Update CODEOWNERs (f6261fd)
- Update tmux-cheatsheet extension (raycast#26379)
- Changelog Alignment (raycast#26824)
- Update prism-launcher extension (raycast#26816)
@spencer-michaels

Copy link
Copy Markdown
Contributor Author

Thank you guys! I noticed a misconfiguration in package.json slipped through — I for some reason put myself as the author and @alikhatibak as a contributor (my mistake, sorry!), which resulted in two versions of the extension showing up in the store (the original version, and my updated version). @0xdhrv, what's the best way for me to fix this? Should I open a new PR with my changes and the misconfiguration fixed, or would changing the misconfiguration just in this new branch fix the issue? Sorry for the confusion, totally my mistake.

Brave Browser 2026-04-02 14 59 10

@0xdhrv

0xdhrv commented Apr 3, 2026

Copy link
Copy Markdown
Member

Thank you guys! I noticed a misconfiguration in package.json slipped through — I for some reason put myself as the author and @alikhatibak as a contributor (my mistake, sorry!), which resulted in two versions of the extension showing up in the store (the original version, and my updated version). @0xdhrv, what's the best way for me to fix this? Should I open a new PR with my changes and the misconfiguration fixed, or would changing the misconfiguration just in this new branch fix the issue? Sorry for the confusion, totally my mistake.

Brave Browser 2026-04-02 14 59 10

let me check

ariesly15 pushed a commit to ariesly15/raycast-extensions that referenced this pull request Apr 10, 2026
- feat[extensions/qq-mail]: 添加QQ邮箱扩展及配置文件
- Merge branch \'raycast:main\' into main
- Update CODEOWNERs (9944a1b)
- [XKCD Comics] Add viewing history (raycast#26704)
- refactor: 增加useCallback并更新tsconfig配置
- Update CODEOWNERs (9b7c8a4)
- Add Kafka UI extension (raycast#26259)
- Merge branch \'raycast:main\' into main
- refactor: 简化 Action.CopyToClipboard 组件调用 (url-parse.tsx)
- chore: 移除 delink 扩展中的图标配置项
- chore: 删除图标文件并更新配置引用新图标
- Update CODEOWNERs (756e9da)
- Update ascii-art-wallpaper extension (raycast#26707)
- Update CODEOWNERs (23ee8a8)
- Add paper-agent extension (raycast#26367)
- Merge branch \'raycast:main\' into main
- chore: 更新 delink 扩展变更日志并移除旧版本记录
- Update CODEOWNERs (768930b)
- Add nocal extension (raycast#26482)
- Update CODEOWNERs (7c0e492)
- Add caaals extension (raycast#26443)
- Merge branch \'raycast:main\' into main
- docs: 更新 delink 扩展文档及快捷键说明
- Update CODEOWNERs (41a12f0)
- Update mirror-displays extension (raycast#26445)
- chore: 更新 delink 扩展的版本信息为初始发布版
- docs: 调整 delink 扩展快捷键说明顺序
- Merge branch \'raycast:main\' into main
- feat:up
- Update CODEOWNERs (2134dff)
- Update hetzner extension (raycast#26705)
- Update CODEOWNERs (840e5a9)
- Add ram-prices extension (raycast#26564)
- Update CODEOWNERs (45fad15)
- Add habitica-todos extension (raycast#26446)
- Update CODEOWNERs (3e686e1)
- Add Bundles extension (raycast#25680)
- Update CODEOWNERs (f6261fd)
- Update tmux-cheatsheet extension (raycast#26379)
- Changelog Alignment (raycast#26824)
- Update prism-launcher extension (raycast#26816)
- Merge branch \'raycast:main\' into main
- feat: add metadata folder and language setting
- Update picgo extension (raycast#26818)
- Update CODEOWNERs (bd7023d)
- Add clockodo extension (raycast#26432)
- feat: add raycast extension delink
- Update CODEOWNERs (868aef4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved Approved by a user extension fix / improvement Label for PRs with extension's fix improvements extension: tmux-cheatsheet Issues related to the tmux-cheatsheet extension platform: macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants