Skip to content

Delay on start session #504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lervag opened this issue Sep 17, 2019 · 4 comments
Closed

Delay on start session #504

lervag opened this issue Sep 17, 2019 · 4 comments

Comments

@lervag
Copy link

lervag commented Sep 17, 2019

Step 1: Provide a summary of your problem

After starting a session with tmuxp load <session-name>, there is a delay of some seconds before the panes accept input.

Step 2: Provide tmuxp details

  • Python version: 3.7.4

  • tmux version: 2.9a

  • tmuxp version: 1.5.3

  • tmux path: /usr/bin/tmux

  • tmuxp path: /usr/bin/tmuxp

  • libtmux version: 0.8.2

  • shell: zsh 5.7.1

  • output of tmux show-options -g:

    activity-action other
    assume-paste-time 1
    base-index 1
    bell-action any
    default-command ""
    default-shell "/usr/bin/zsh"
    default-size "80x24"
    destroy-unattached off
    detach-on-destroy on
    display-panes-active-colour red
    display-panes-colour blue
    display-panes-time 1000
    display-time 750
    history-limit 20480
    key-table "root"
    lock-after-time 0
    lock-command "lock -np"
    message-command-style fg=yellow,bg=black
    message-style fg=colour15,bg=colour0
    mouse on
    prefix C-q
    prefix2 None
    renumber-windows off
    repeat-time 500
    set-titles off
    set-titles-string "#S:#I:#W - \"#T\" #{session_alerts}"
    silence-action other
    status on
    status-bg colour0
    status-fg colour14
    status-format[0] "#[align=left range=left #{status-left-style}]#{T;=/#{status-left-length}:status-left}#[norange default]#[list=on align=#{status-justify}]#[list=left-marker]<#[list=right-marker]>#[list=on]#{W:#[range=window|#{window_index} #{window-status-style}#{?#{&&:#{window_last_flag},#{!=:#{window-status-last-style},default}}, #{window-status-last-style},}#{?#{&&:#{window_bell_flag},#{!=:#{window-status-bell-style},default}}, #{window-status-bell-style},#{?#{&&:#{||:#{window_activity_flag},#{window_silence_flag}},#{!=:#{window-status-activity-style},default}}, #{window-status-activity-style},}}]#{T:window-status-format}#[norange default]#{?window_end_flag,,#{window-status-separator}},#[range=window|#{window_index} list=focus #{?#{!=:#{window-status-current-style},default},#{window-status-current-style},#{window-status-style}}#{?#{&&:#{window_last_flag},#{!=:#{window-status-last-style},default}}, #{window-status-last-style},}#{?#{&&:#{window_bell_flag},#{!=:#{window-status-bell-style},default}}, #{window-status-bell-style},#{?#{&&:#{||:#{window_activity_flag},#{window_silence_flag}},#{!=:#{window-status-activity-style},default}}, #{window-status-activity-style},}}]#{T:window-status-current-format}#[norange list=on default]#{?window_end_flag,,#{window-status-separator}}}#[nolist align=right range=right #{status-right-style}]#{T;=/#{status-right-length}:status-right}#[norange default]"
    status-format[1] "#[align=centre]#{P:#{?pane_active,#[reverse],}#{pane_index}[#{pane_width}x#{pane_height}]#[default] }"
    status-interval 15
    status-justify left
    status-keys vi
    status-left " "
    status-left-length 10
    status-left-style default
    status-position bottom
    status-right "#[fg=colour15] #S "
    status-right-length 40
    status-right-style default
    status-style fg=colour14,bg=colour0
    update-environment[0] "DISPLAY"
    update-environment[1] "KRB5CCNAME"
    update-environment[2] "SSH_ASKPASS"
    update-environment[3] "SSH_AUTH_SOCK"
    update-environment[4] "SSH_AGENT_PID"
    update-environment[5] "SSH_CONNECTION"
    update-environment[6] "WINDOWID"
    update-environment[7] "XAUTHORITY"
    visual-activity off
    visual-bell off
    visual-silence off
    word-separators " -_@"
    
  • output of tmux show-window-options -g:

    aggressive-resize off
    allow-rename off
    alternate-screen on
    automatic-rename on
    automatic-rename-format "#{?pane_in_mode,[tmux],#{pane_current_command}}#{?pane_dead,[dead],}"
    clock-mode-colour blue
    clock-mode-style 24
    main-pane-height 24
    main-pane-width 80
    mode-keys vi
    mode-style fg=black,bg=yellow
    monitor-activity off
    monitor-bell on
    monitor-silence 0
    other-pane-height 0
    other-pane-width 0
    pane-active-border-style fg=colour12
    pane-base-index 1
    pane-border-format "#{?pane_active,#[reverse],}#{pane_index}#[default] \"#{pane_title}\""
    pane-border-status off
    pane-border-style fg=colour12
    remain-on-exit off
    synchronize-panes off
    window-active-style default
    window-size smallest
    window-status-activity-style reverse
    window-status-bell-style reverse
    window-status-current-format "#I:#W#{?window_flags,#{window_flags}, }"
    window-status-current-style fg=colour15
    window-status-format "#I:#W#{?window_flags,#{window_flags}, }"
    window-status-last-style default
    window-status-separator " "
    window-status-style default
    window-style default
    wrap-search on
    xterm-keys on
    
  • output of tmuxp freeze <SESSION_NAME>:

    session_name: NAME
    windows:
    - focus: 'true'
      layout: 088f,213x53,0,0{106x53,0,0,1,106x53,107,0,2}
      options:
        automatic-rename: 'off'
      panes:
      - shell_command:
        - cd ~/test
        - nvim
      - focus: 'true'
        shell_command: cd ~/test/src
      window_name: dev
    

Step 3: Describe your environment

  • OS version: Arch Linux

Step 4: Describe the problem:

Steps to reproduce:

  1. Create following yaml session file (e.g. ~/.tmuxp/test.yaml):

    session_name: test
    windows:
    - panes:
        - exit
  2. Start session with time tmuxp load test.

Observed Results:

Loading and exiting session takes ~10 seconds.

Expected Results:

Loading and exiting session should be near immediate.

Comment

With some help I might be able to debug this myself. At least I am willing to try. But I would be interested to know if this is immediately reproducable by any of the more experienced devs first.

@lervag
Copy link
Author

lervag commented Sep 17, 2019

Additional input: The problem seems to have partly been reported by @oblitum already in November 2017, see #316 (comment):

The message "no previous window" always shows up when switching to tmuxp created sessions. Not only it shows up, I've noticed there's now quite a delay for the layout to load up when running tmuxp load -y ./foo.yaml. It spends some seconds in a blank state before the layout loads.

This seems to summarize my issue almost perfectly. The issue has existed for me for a long time, probably since before November 2017.

@lervag
Copy link
Author

lervag commented Sep 18, 2019

It seems the delay is caused by my shell (zsh), which for some reason gives large delays when starting in a seemingly random way. The issue was related to compinit, and I solved it by ensuring that the zcompdump file is only generated once a day, i.e. with

# Load completion modules
autoload -Uz compinit

# Flush cached completion configuration once every day
if [[ -n ~/.zcompdump(#qN.mh+24) ]]; then
  compinit
else
  compinit -C
fi

@lervag lervag closed this as completed Sep 18, 2019
@oblitum
Copy link

oblitum commented Jan 28, 2020

@lervag I have that same setting as that in my .zshrc but it doesn't help fixing the problem, still same "no previous window" message (which shows up not only when starting the session, but anytime I switch back to it), still same delay. Was just giving it a try again, sadly, time to go back to tmuxp 1.3.2/libtmux 0.7.4...

@luc-vocab
Copy link

Hi, i'm also having this issue with "no previous window" displayed when switching sessions with a keybinding, in my case it seems to happen when sessions are created with tmuxp when another session previously exists, and only if the session has a single window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants