2016-12-05 8 views
2

私はtmux-continuumプラグインとtmux-resurrectプラグインを使用しています。Tmuxの復元で空のセッションが作成される

$ tmux ls 
$ failed to connect to server: No such file or directory 

をそれから私が起動するとき、それは自動的に私の保存されたセッションプラス(通常0無名のセッション

$ tmux 
$ tmux ls 
    0: 1 windows (created...) 
    saved_session_1: 1 windows (created...) 
    saved_session_2: 1 windows (created...) 
    ... 
を復元tmuxは:私はtmuxのを殺す場合は、次のコマンドを実行します(たとえば私のマシンを再起動)し、

私の現在のワークフローは、このように書きます:

  • スタートtmux
  • から
  • デタッチ私はこの私はtmuxのを再起動するたびに繰り返す必要がし​​たくない私の保存されたセッションの1つ

に取り付け

  • キル無名のセッション無名のセッションへのアタッチ。名前のないセッションを作成せずに、保存したtmuxセッションを復元するにはどうしたらいいですか?

  • 答えて

    0

    次のコマンドを実行します(好ましくは別名それを作る):

    $ tmux new-session -A -s [session-name] 
    

    旗の意味:

    -s refers to session name. 
    -A In case session-name exists, command will act like attach-session instead of new-session. 
    

    公式ドキュメントのmanページを参照してください。

    $ man tmux 
    
    new-session [-AdDEP] [-c start-directory] [-F format] [-n window-name] [-s session-name] [-t 
         target-session] [-x width] [-y height] [shell-command] 
           (alias: new) 
         Create a new session with name session-name. 
    
         The new session is attached to the current terminal unless -d is given. window-name and 
         shell-command are the name of and shell command to execute in the initial window. If -d 
         is used, -x and -y specify the size of the initial window (80 by 24 if not given). 
    
         If run from a terminal, any termios(4) special characters are saved and used for new win‐ 
         dows in the new session. 
    
         The -A flag makes new-session behave like attach-session if session-name already exists; 
         in this case, -D behaves like -d to attach-session. 
    
         If -t is given, the new session is grouped with target-session. This means they share 
         the same set of windows - all windows from target-session are linked to the new session, 
         any new windows are linked to both sessions and any windows closed removed from both ses‐ 
         sions. The current and previous window and any session options remain independent and 
         either session may be killed without affecting the other. -n and shell-command are 
         invalid if -t is used. 
    
         The -P option prints information about the new session after it has been created. By 
         default, it uses the format ‘#{session_name}:’ but a different format may be specified 
         with -F. 
    
         If -E is used, the update-environment option will not be applied. 
    
    関連する問題