![tmux의 $SHELL은 내가 시작한 쉘의 $SHELL과 다릅니다.](https://linux55.com/image/166264/tmux%EC%9D%98%20%24SHELL%EC%9D%80%20%EB%82%B4%EA%B0%80%20%EC%8B%9C%EC%9E%91%ED%95%9C%20%EC%89%98%EC%9D%98%20%24SHELL%EA%B3%BC%20%EB%8B%A4%EB%A6%85%EB%8B%88%EB%8B%A4..png)
나는 이 문제로 몇 시간 동안 고생했고 그것이 나를 미치게 만들었습니다. 집에 있는 컴퓨터에 SSH로 접속할 때 기본 셸은 zsh입니다. 나는 이것을 확인할 수 echo $SHELL
있습니다/usr/bin/zsh
zsh에서 tmux를 호출하면 bash 쉘이 있는 tmux 창으로 이동됩니다. 을 실행하면 가 echo $SHELL
출력되고 /bin/bash
, 을 실행하면 chsh -s /usr/bin/zsh <user>
$SHELL 변수가 실제로 업데이트되지 않고 계속 출력됩니다 \bin\bash
.
tmux 매뉴얼 페이지에서 기본 쉘이 ~/.tmux.conf 파일에 설정되어 있다는 것을 알고 그렇게 했지만 효과가 없는 것 같습니다. 여기에 관련 구성 파일을 포함하겠습니다.
내 .tmux.conf의 다른 구성을 언급해야 합니다.예작동합니다. 키 바인딩이 작동하고 색상이 일치합니다. 그것을 알아낼 수 없습니다. 어떤 도움이라도 대단히 감사하겠습니다.
하드웨어는 최신 버전의 Raspbian을 실행하는 Raspberry Pi 4입니다.
~/.tmux.conf:
unbind C-b
set-option -g prefix C-q
bind-key C-q send-prefix
bind h split-window
bind v split-window -h
#set-option -g pane-border-fg colour235 #base02
#set-option -g pane-active-border-fg colour240 #base01
set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
setw -g mode-keys vi
setw -g monitor-activity on
bind-key -r J resize-pane -D 5
bind-key -r K resize-pane -U 5
bind-key -r H resize-pane -L 5
bind-key -r L resize-pane -R 5
bind-key -n M-K resize-pane -U 5
bind-key -n M-J resize-pane -D 5
bind-key -n M-H resize-pane -L 5
bind-key -n M-L resize-pane -R 5
# Shift arrow to switch windows
bind -n M-N previous-window
bind -n M-M next-window
set -sg escape-time 0
# Smart pane switching with awareness of Vim splits.
# See: 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 C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
set -g status-bg "black"
set -g status-fg "white"
~/.zshrc는 좋은 척도입니다.
# OMZ home directory
export ZSH=/home/joe/.oh-my-zsh
# Set OMZ theme
ZSH_THEME=spaceship
SPACESHIP_CHAR_SUFFIX=' '
SPACESHIP_HOST_SHOW=always
SPACESHIP_USER_SHOW=always
SPACESHIP_PROMPT_ORDER=(
user # Username section
host # Hostname section
dir # Current directory section
git # Git section (git_branch + git_status)
exec_time # Execution time
battery # Battery level and status
vi_mode # Vi-mode indicator
jobs # Background jobs indicator
exit_code # Exit code section
char # Prompt character
)
# Couple OMZ settings
COMPLETION_WAITING_DOTS="true"
plugins=(git sudo wd tmux)
# Source OMZ file, needs to be *before* other aliases
source $ZSH/oh-my-zsh.sh
# Fixes some undesirable behavior in Termite with OMZ
export LC_CTYPE="en_US.UTF-8"
export ANDROID_HOME="/home/joe/Android/Sdk/"
# User Specified Aliases
alias ekeymap="vim /home/joe/qmk_firmware/keyboards/ergodox_ez/keymaps/josephemorgan91"
alias rename=perl-rename
alias zconfig="vim ~/.zshrc"
alias zsource="source ~/.zshrc"
alias ls="ls --color=auto"
alias la="ls -a --color=auto"
alias ll="ls -la --color=auto"
alias keyswapper="~/Scripts/keyswapper"
alias sheader="~/Scripts/student_header.sh"
alias ctags="ctags -R -f ./.git/tags ."
alias tmux="tmux -u"
alias R="R --quiet"
alias update-grub="sudo zsh ~/Scripts/update-grub"
alias vimconfig="vim ~/.vimrc"
alias emacs="emacs -nw"
# Setup folder for dev
alias cconfig="cp ~/Scripts/ycm_c_config ./.ycm_extra_config.py"
alias gitignore="cp ~/.dotfiles/.gitignore ./.gitignore"
alias readme="cp ~/.dotfiles/.README_TEMPLATE ./README"
alias gogit="readme & gitignore & git init"
set_wallpaper() {
echo "Setting wallpaper: $PWD/$1\n"
ln -s -f -v $PWD/$1 /home/joe/.wallpaper.jpg
ln -s -f -v $PWD/$2 /home/joe/.wallpaper-lh.jpg
feh --bg-scale $PWD/$2 --bg-scale $PWD/$1
}
# Uses xclip application to pipe output to clipboard.
# Usage - $ cat /path/to/a/file | xclip
# Works on any utility that produces output
alias xclip="xclip -selection c"
export EDITOR='vim'
export term="xterm-256color"
# if command -v tmux>/dev/null; then
# [[ ! $TERM =~ screen ]] && [ -z $TMUX ] && exec tmux
# fi
stty -ixon
xset r rate 200 45
답변1
해결책은 .tmux.conf에 다음 줄을 추가하는 것입니다.
set-option -g default-shell /bin/zsh
어리석은 점은 내가 이것을 확실히 알고 실제로 그 줄을 추가했지만 파일을 저장하거나 그렇게 한 후 서버를 다시 시작하지 않은 것 같습니다. 다음날 연결했을 때 모든 것이 잘 작동하기 시작했습니다.