diff --git a/bash_completion_tmux.sh b/bash_completion_tmux.sh deleted file mode 100644 index 74728b91e3aa7ef49d3c3cb4cb13666d0cf29eae..0000000000000000000000000000000000000000 --- a/bash_completion_tmux.sh +++ /dev/null @@ -1,105 +0,0 @@ -# START tmux completion -# This file is in the public domain -# See: http://www.debian-administration.org/articles/317 for how to write more. -# Usage: Put "source bash_completion_tmux.sh" into your .bashrc -_tmux() -{ - local cur prev opts - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - - opts=" \ - attach-session \ - bind-key \ - break-pane \ - capture-pane \ - choose-client \ - choose-session \ - choose-window \ - clear-history \ - clock-mode \ - command-prompt \ - confirm-before \ - copy-buffer \ - copy-mode \ - delete-buffer \ - detach-client \ - display-message \ - display-panes \ - down-pane \ - find-window \ - has-session \ - if-shell \ - join-pane \ - kill-pane \ - kill-server \ - kill-session \ - kill-window \ - last-window \ - link-window \ - list-buffers \ - list-clients \ - list-commands \ - list-keys \ - list-panes \ - list-sessions \ - list-windows \ - load-buffer \ - lock-client \ - lock-server \ - lock-session \ - move-window \ - new-session \ - new-window \ - next-layout \ - next-window \ - paste-buffer \ - pipe-pane \ - previous-layout \ - previous-window \ - refresh-client \ - rename-session \ - rename-window \ - resize-pane \ - respawn-window \ - rotate-window \ - run-shell \ - save-buffer \ - select-layout \ - select-pane \ - select-prompt \ - select-window \ - send-keys \ - send-prefix \ - server-info \ - set-buffer \ - set-environment \ - set-option \ - set-window-option \ - show-buffer \ - show-environment \ - show-messages \ - show-options \ - show-window-options \ - source-file \ - split-window \ - start-server \ - suspend-client \ - swap-pane \ - swap-window \ - switch-client \ - unbind-key \ - unlink-window \ - up-pane" - - COMPREPLY=($(compgen -W "${opts}" -- ${cur})) - return 0 - -} -complete -F _tmux tmux - -# END tmux completion - - - diff --git a/tmux b/tmux new file mode 100644 index 0000000000000000000000000000000000000000..e4e83a78b4504bb0b6e0d3ea3d57955f94dd0634 --- /dev/null +++ b/tmux @@ -0,0 +1,183 @@ +#!/usr/bin/env bash + +# Copy of https://github.com/Bash-it/bash-it/blob/master/completion/available/tmux.completion.bash +# and https://github.com/przepompownia/bash-it/blob/master/completion/available/tmux.completion.bash +# slightly refactored + +# tmux completion +# See: http://www.debian-administration.org/articles/317 for how to write more. +# Usage: Put "source bash_completion_tmux.sh" into your .bashrc +# Based upon the example at http://paste-it.appspot.com/Pj4mLycDE + +function _tmux_complete_client() { + local IFS=$'\n' + local cur="${1}" && shift + COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W "$(tmux "$@" list-clients -F '#{client_tty}' 2> /dev/null)" -- "${cur}") ) + options="" + return 0 +} + +function _tmux_complete_session() { + local IFS=$'\n' + local cur="${1}" && shift + COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W "$(tmux "$@" list-sessions -F '#{session_name}' 2> /dev/null)" -- "${cur}") ) + options="" + return 0 +} + +function _tmux_complete_window() { + local IFS=$'\n' + local cur="${1}" && shift + local session_name="$(echo "${cur}" | sed 's/\\//g' | cut -d ':' -f 1)" + local sessions + + sessions="$(tmux "$@" list-sessions 2> /dev/null | sed -re 's/([^:]+:).*$/\1/')" + if [[ -n "${session_name}" ]]; then + sessions="${sessions} + $(tmux "$@" list-windows -t "${session_name}" 2> /dev/null | sed -re 's/^([^:]+):.*$/'"${session_name}"':\1/')" + fi + cur="$(echo "${cur}" | sed -e 's/:/\\\\:/')" + sessions="$(echo "${sessions}" | sed -e 's/:/\\\\:/')" + COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W "${sessions}" -- "${cur}") ) + options="" + return 0 +} + +function _tmux_complete_socket_name() { + local IFS=$'\n' + local cur="${1}" && shift + COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W "$(find "${TMUX_TMPDIR:-/tmp}/tmux-$UID" -type s -printf '%P\n')" -- "${cur}") ) + options="" + return 0 +} +function _tmux_complete_socket_path() { + local IFS=$'\n' + local cur="${1}" && shift + COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W "$(find "${TMUX_TMPDIR:-/tmp}/tmux-$UID" -type s -printf '%p\n')" -- "${cur}") ) + options="" + return 0 +} + +__tmux_init_completion() +{ + COMPREPLY=() + _get_comp_words_by_ref cur prev words cword +} + +_tmux() { + local cur prev words cword; + if declare -F _init_completion >/dev/null 2>&1; then + _init_completion + else + __tmux_init_completion + fi + + local index=1 + # Check tmux options that will change completion for: + # - available sessions + # - available windows + # - ... + local argv=( "${words[@]:1}" ) + local OPTIND OPTARG OPTERR=0 flag tmux_args=() + while getopts "L:S:" flag "${argv[@]}"; do + case "$flag" in + L) tmux_args+=(-L "$OPTARG") ;; + S) tmux_args+=(-S "$OPTARG") ;; + *) ;; + esac + done + # Completed -- have a space after + if [[ ${#words[@]} -gt $OPTIND ]]; then + local tmux_argc=${#tmux_args[@]} + (( index+=tmux_argc )) + (( cword-=tmux_argc )) + fi + + if [[ $cword -eq 1 ]]; then + COMPREPLY=($( compgen -W "$(tmux start\; list-commands | cut -d' ' -f1)" -- "$cur" )); + return 0 + else + case ${words[index]} in + -L) _tmux_complete_socket_name "${cur}" ;; + -S) _tmux_complete_socket_path "${cur}" ;; + + attach-session|attach) + case "$prev" in + -t) _tmux_complete_session "${cur}" "${tmux_args[@]}" ;; + *) options="-t -d" ;; + esac ;; + detach-client|detach) + case "$prev" in + -t) _tmux_complete_client "${cur}" "${tmux_args[@]}" ;; + *) options="-t" ;; + esac ;; + lock-client|lockc) + case "$prev" in + -t) _tmux_complete_client "${cur}" "${tmux_args[@]}" ;; + *) options="-t" ;; + esac ;; + lock-session|locks) + case "$prev" in + -t) _tmux_complete_session "${cur}" "${tmux_args[@]}" ;; + *) options="-t -d" ;; + esac ;; + new-session|new) + case "$prev" in + -t) _tmux_complete_session "${cur}" "${tmux_args[@]}" ;; + -[n|d|s]) options="-d -n -s -t --" ;; + *) + if [[ ${COMP_WORDS[option_index]} == -- ]]; then + _command_offset ${option_index} + else + options="-d -n -s -t --" + fi + ;; + esac + ;; + refresh-client|refresh) + case "$prev" in + -t) _tmux_complete_client "${cur}" "${tmux_args[@]}" ;; + *) options="-t" ;; + esac ;; + rename-session|rename) + case "$prev" in + -t) _tmux_complete_session "${cur}" "${tmux_args[@]}" ;; + *) options="-t" ;; + esac ;; + has-session|has|kill-session) + case "$prev" in + -t) _tmux_complete_session "${cur}" "${tmux_args[@]}" ;; + *) options="-t" ;; + esac ;; + source-file|source) + _filedir ;; + suspend-client|suspendc) + case "$prev" in + -t) _tmux_complete_client "${cur}" "${tmux_args[@]}" ;; + *) options="-t" ;; + esac ;; + switch-client|switchc) + case "$prev" in + -c) _tmux_complete_client "${cur}" "${tmux_args[@]}" ;; + -t) _tmux_complete_session "${cur}" "${tmux_args[@]}" ;; + *) options="-l -n -p -c -t" ;; + esac ;; + + send-keys|send) + case "$option" in + -t) _tmux_complete_window "${cur}" "${tmux_args[@]}" ;; + *) options="-t" ;; + esac ;; + esac # case ${cmd} + fi # command specified + + if [[ -n "${options}" ]]; then + COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W "${options}" -- "${cur}") ) + fi + + return 0 +} +# http://linux.die.net/man/1/bash +complete -F _tmux tmux + +# END tmux completion diff --git a/tmux-3.4.tar.gz b/tmux-3.4.tar.gz deleted file mode 100644 index 6c26a923f8bae08201ca599d33eca58b80d5906d..0000000000000000000000000000000000000000 Binary files a/tmux-3.4.tar.gz and /dev/null differ diff --git a/tmux-3.5a.tar.gz b/tmux-3.5a.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d08a2d4450fa0b68cd88291a49cde4642e3d40ed Binary files /dev/null and b/tmux-3.5a.tar.gz differ diff --git a/tmux.spec b/tmux.spec index f2c6afe0fce4d98420b99b6312d20ea67b47b183..a4f6c503a948d3def9ae3598c4f026f62ecc98f1 100644 --- a/tmux.spec +++ b/tmux.spec @@ -1,36 +1,42 @@ %global _hardened_build 1 Name: tmux -Version: 3.4 +Version: 3.5a Release: 1 Summary: A terminal multiplexer -License: ISC and BSD +# SOURCE0 licensed under ISC AND BSD, SOURCE1 licensed under GPL-2.0-only +License: ISC AND BSD-2-Clause AND BSD-3-Clause AND GPL-2.0-only URL: https://tmux.github.io/ -Source0: https://github.com/%{name}/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz -Source1: bash_completion_tmux.sh +Source0: https://github.com/tmux/tmux/releases/download/%{version}/%{name}-%{version}.tar.gz +Source1: https://github.com/imomaliev/tmux-bash-completion/raw/refs/heads/master/completions/tmux -BuildRequires: gcc libevent-devel ncurses-devel libutempter-devel byacc systemd-devel +BuildRequires: gcc +BuildRequires: (pkgconfig(libevent_core) >= 2 or pkgconfig(libevent) >= 2) +BuildRequires: (pkgconfig(tinfo) or pkgconfig(ncurses) or pkgconfig(ncursesw)) +BuildRequires: pkgconfig(libsystemd) +BuildRequires: pkgconfig(libutf8proc) +BuildRequires: libutempter-devel +BuildRequires: bison %description %{name} is a terminal multiplexer. It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal. -%package_help +%package_help %prep %autosetup %build -%configure --enable-sixel --enable-systemd --enable-utempter +%configure --enable-sixel --enable-systemd --enable-utempter --enable-utf8proc %make_build - %install %make_install -install -Dpm 644 %{SOURCE1} %{buildroot}%{_datadir}/bash-completion/completions/%{name} +install -Dpm 644 %{S:1} %{buildroot}%{_datadir}/bash-completion/completions/%{name} %post if [ "$1" = 1 ]; then @@ -52,16 +58,17 @@ if [ "$1" = 0 ] && [ -f %{_sysconfdir}/shells ] ; then fi %files -%defattr(-,root,root) %license COPYING %{_bindir}/%{name} %{_datadir}/bash-completion/completions/%{name} %files help -%defattr(-,root,root) -%{_mandir}/man1/%{name}.1.gz +%{_mandir}/man1/%{name}.1* %changelog +* Sat Oct 05 2024 Funda Wang - 3.5a-1 +- update to version 3.5a + * Thu Feb 29 2024 wangqia - 3.4-1 - Update to version 3.4 diff --git a/tmux.yaml b/tmux.yaml index bd2a371601d7674ce976b30267246a7d0f8d33ff..cc6cad701e3858cf7ca917d06cb6e059a00b8326 100644 --- a/tmux.yaml +++ b/tmux.yaml @@ -1,4 +1,4 @@ version_control: github src_repo: tmux/tmux -tag_prefix: "^v" -seperator: "." +tag_prefix: +separator: .