All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

Creating Cross-Shell Tab-Completions for Bash and Zsh

By

lihaoyi

9mo ago· 7 min readen

Summary

The article discusses the challenges of implementing shell tab-completions for both Bash and Zsh, highlighting the differences in their APIs and the lack of descriptive completions in Bash. It provides insights into how developers can create cross-shell tab-completions with quality-of-life features.

Key quotes

· 3 pulled
Shell tab-completions can be very handy, but setting them up is complicated by the fact that half your users would be using Bash-on-Linux, while the other half will be using Zsh-on-OSX, each of which has different tab-completion APIs.
Most users exploring an unfamiliar CLI tool using tab completion appreciate showing a description along with each completion so they can read what it is, but that’s normally only available on Zsh and not on Bash.
With some work, you can make your tab-completions work on both shells, including nice quality-of-life features.
Snippet from the RSS feed
Li Haoyi, 7 August 2025

You might also wanna read