austinjones / tab-rs

The intuitive, config-driven terminal multiplexer designed for software & systems engineers
MIT License
659 stars 29 forks source link

Check for existence of included completions in shell scripts #259

Open TheTeXnician opened 3 years ago

TheTeXnician commented 3 years ago

As a Linux user on multiple machines, I have my dotfiles under version control. This especially includes the .bashrc, .zshrc and fish configuration. When using these dotfiles with the modifications tab made automatically on other machines without tab (sad but true, those still exist…), it would be useful if they were safe-guarded against inclusion to not cause errors if they do not even exist.

For instance, in my .bashrc I'm using the following

if [ -f "~/.local/share/tab/completion/tab.bash" ]; then
    source ~/.local/share/tab/completion/tab.bash
fi

Maybe it would be useful for others as well to include something like that into the default auto-generated code.

austinjones commented 3 years ago

Yeah! That would be a great improvement.