安装旧版本的软件包 (tmux)

安装旧版本的软件包 (tmux)

有没有一种安全的方法可以安装旧版本的软件包?我正在使用 Debian 11,我想安装 tmux 2.6 版本,因为这是我在另一台装有 Debian 9 的计算机上使用的版本。

看来在 Debian 11 中安装 tmux 2.6 比在 Debian 9 中安装 tmux 3.1 更安全。

附言。配置文件使它们不兼容。

编辑以发布我的 tmux 2.6 配置文件,该文件在 tmux 3.1 中不起作用:

#----------------------------------------------------------------
# Key bindings
#----------------------------------------------------------------

# Change the default prefix binding
unbind-key C-b
set -g prefix C-Space
bind-key Space send-prefix

# Use Zsh as default shell
# Disable it if you don't use Zsh
set-option -g default-shell /bin/zsh

# Limit the scrollback buffer to 10000 lines
set-option -g history-limit 10000

# 256 colors support
set -g default-terminal 'screen-256color'

# Add Ss and Se capabilities for Nvim (see :h tui-cursor-shape)
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'

# Enable xterm-keys
set-window-option -g xterm-keys on
set-window-option -g mode-keys vi

# Enable mouse
set -g mouse on

# Faster command sequences
set -sg escape-time 0

# Window titles
setw -g automatic-rename on
set-option -g set-titles on
set-option -g set-titles-string "#T"

# Start numbering from 1
set-option -g base-index 1
setw -g pane-base-index 1

# Windows navigation (Vim-like)
bind-key -n C-M-h previous-window
bind-key -n C-M-l next-window
bind-key -n C-M-p last-window
bind-key -n C-M-n new-window
bind-key -n C-M-j kill-pane
bind-key -n M-n new-window
bind-key -n M-x kill-pane

bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
bind-key -n M-0 select-window -t 10

# Split window into panes
unbind-key '"'
unbind-key %
bind-key -n M-. split-window -h
bind-key -n M-- split-window -v

# Panes
bind-key -n M-e list-panes
bind-key -n M-t clock-mode

# Panes navigation (Vim-like)
# bind-key -n M-h select-pane -L
# bind-key -n M-l select-pane -R
# bind-key -n M-k select-pane -U
# bind-key -n M-j select-pane -D

# Move between Tmux panes and Vim windows
# - It requires the corresponding configuration into Vim.
# - Check it at my .vimrc, section 9 («Multiple windows»).
# - URL: https://github.com/gerardbm/vimrc/blob/master/vimrc
# - Plugin required: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
    | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n M-h if-shell "$is_vim" "send-keys M-h"  "select-pane -L"
bind-key -n M-j if-shell "$is_vim" "send-keys M-j"  "select-pane -D"
bind-key -n M-k if-shell "$is_vim" "send-keys M-k"  "select-pane -U"
bind-key -n M-l if-shell "$is_vim" "send-keys M-l"  "select-pane -R"
bind-key -n M-\ if-shell "$is_vim" "send-keys M-\\" "select-pane -l"

# Swap panes (Vim-like)
bind-key -n M-P swap-pane -U
bind-key -n M-N swap-pane -D

# Resize panes (Vim-like)
bind-key -n M-f resize-pane -Z
bind-key -n M-H resize-pane -L 1
bind-key -n M-L resize-pane -R 1
bind-key -n M-K resize-pane -U 1
bind-key -n M-J resize-pane -D 1

# Copy mode (Vim-like)
bind-key -n M-Space copy-mode
bind-key -T copy-mode-vi Escape send-keys -X cancel
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'V' send-keys -X select-line
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
bind-key -T copy-mode-vi 'r' send-keys -X rectangle-toggle
bind-key -T copy-mode-vi 'u' send-keys -X page-up
bind-key -T copy-mode-vi 'd' send-keys -X page-down
bind-key -T copy-mode-vi Space command-prompt -i -p "search-forward" "send -X search-forward-incremental \"%%%\""

# TODO: toggle function to use only 'ñ'
bind-key -T copy-mode-vi 'ñ' send-keys -X start-of-line
bind-key -T copy-mode-vi 'Ñ' send-keys -X end-of-line

# Not using the following (I prefer the clipboard)
# bind-key -T copy-mode-vi 'y' send-keys -X copy-selection
# bind-key p paste-buffer

# Reload configuration
bind-key -n C-M-r source-file ~/.tmux.conf \; display "Tmux settings reloaded!"

# URLview
bind-key -n C-M-o capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlview" '$SHELL -c "urlview < /tmp/tmux-buffer"'

#----------------------------------------------------------------
# Color Settings
# - The installation of Powerline fonts is highly recommended
# - URL: https://github.com/powerline/fonts
#----------------------------------------------------------------

# Message text
set-option -g message-fg colour3
set-option -g message-bg colour8

# Modes
setw -g mode-fg colour0
setw -g mode-bg colour6
setw -g clock-mode-colour colour6
setw -g clock-mode-style 24

# Panes border
set -g pane-border-bg colour0
set -g pane-border-fg colour7
set -g pane-active-border-bg colour0
set -g pane-active-border-fg colour6

# Panes number
set-option -g display-panes-active-colour colour2
set-option -g display-panes-colour colour6

# Statusbar
set -g status-fg colour6
set -g status-bg colour8
set -g status-left '#[fg=colour0,bg=colour6] s:#S #[default] '
set -g status-right '#[default]  %m-%d #[fg=colour0,bg=colour6] %H:%M '
set -g status-attr none

# Statusbar layout
set -g status-position bottom
set -g status-justify left
set -g status-right-length 50
set -g status-left-length 50

# Statusbar window tab
set-option -gw window-status-fg colour0
set-option -gw window-status-bg colour7
set-option -gw window-status-format "#[fg=colour8,bg=colour7]#[default] #I#{?window_activity_flag,#[fg=colour0]~,:}#[default] #W #[fg=colour7,bg=colour8,nobold]"
set-option -gw window-status-attr none

# Statusbar window tab current
set-option -gw window-status-current-fg colour0
set-option -gw window-status-current-bg colour4
set-option -gw window-status-current-format "#[fg=colour8,bg=colour4]#[default] #I#{?window_active,),} #W #[fg=colour4,bg=colour8]"
set-option -gw window-status-current-attr none

# Statusbar window tab activity
set-option -gw window-status-activity-fg colour0
set-option -gw window-status-activity-bg colour7
set-option -gw window-status-activity-attr none

# ↑ The attributes is either none or a comma-delimited list
# of one or more of: bright (or bold), dim, underscore,
# blink, reverse, hidden, or italics, to turn an attribute
# on, or an attribute prefixed with `no' to turn one off.

# Alerts
set-option -gw monitor-activity on
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence on
set-option -g display-time 1500

相关内容