mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 05:53:22 -07:00
POC: Adding bash-completion to byobu.
* Linking repositories containing the files for future traceability (License: GPLv2) * Symlinking the required files * Adding bash-completion to byobu executables: * Hard-coding `byobu-tmux` and `byobu-screen` to respected complete-functions * Small shim to redirect on the correct bash-completion function in case of using the plain `byobu` (as expected on the normal usecase) Tested under Ubuntu 16.04.3. _Note that unfortunately, I didn't have screen installed to test or verify the actual usage of `screen` file. I am not familiar with `screen` commands, but I was seeing bash functionality "completed". However, autocomplete changed realtime to the contents of `source`d file._ Signed-off-by: Ntentos Stavros <133706+stdedos@users.noreply.github.com>
This commit is contained in:
parent
317213afc4
commit
9208fc1cdc
6 changed files with 27 additions and 0 deletions
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[submodule "bash-completion"]
|
||||||
|
path = bash-completion
|
||||||
|
url = https://github.com/GArik/bash-completion.git
|
||||||
|
[submodule "tmux-bash-completion"]
|
||||||
|
path = tmux-bash-completion
|
||||||
|
url = https://github.com/imomaliev/tmux-bash-completion.git
|
1
bash-completion
Submodule
1
bash-completion
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit afe39fd1e171d0ea3d4fb8ec0d8c8c14fa120ed8
|
17
etc/bash_completion.d/byobu
Normal file
17
etc/bash_completion.d/byobu
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
_byobu() {
|
||||||
|
source <(sed 's/^/local /' "${HOME}/.byobu/backend")
|
||||||
|
|
||||||
|
if [ "${BYOBU_BACKEND}" == tmux ] ; then
|
||||||
|
_tmux "$@"
|
||||||
|
elif [ "${BYOBU_BACKEND}" == screen ] ; then
|
||||||
|
_screen "$@"
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
complete -F _byobu byobu
|
||||||
|
complete -F _tmux byobu-tmux
|
||||||
|
complete -F _screen byobu-screen
|
1
etc/bash_completion.d/screen
Symbolic link
1
etc/bash_completion.d/screen
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
bash-completion/completions/screen
|
1
etc/bash_completion.d/tmux
Symbolic link
1
etc/bash_completion.d/tmux
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
tmux-bash-completion/completions/tmux
|
1
tmux-bash-completion
Submodule
1
tmux-bash-completion
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 847eda60c4664bfca833a086a3e2167957c26be0
|
Loading…
Add table
Add a link
Reference in a new issue