<commit_before>status is-interactive; or exit

function __tmux_session_name
  if is_ssh
    # is a remote login
    printf '%s-%s' (prompt_hostname) (string replace -a '.' '-' (string split ' ' $SSH_CONNECTION)[1])
  else if not is_tmux
    if not string match -rq '^/dev/(pts/\d+|ttys\d+)$' $tty; and not is_wsl1
      # is a console/tty
      printf '%s' $tty
    else
      # is a terminal/pty
      printf '%s' (prompt_hostname)
    end
  else
    # no nested tmux
    return 1
  end
end

function __tmux_auto_launch --on-event fish_startup
  set session (__tmux_session_name); or return

  if not tmux has-session -t $session
    tmux new -s $session<commit_msg>fish: silence tmux startup<commit_after>status is-interactive; or exit

function __tmux_session_name
  if is_ssh
    # is a remote login
    printf '%s-%s' (prompt_hostname) (string replace -a '.' '-' (string split ' ' $SSH_CONNECTION)[1])
  else if not is_tmux
    if not string match -rq '^/dev/(pts/\d+|ttys\d+)$' $tty; and not is_wsl1
      # is a console/tty
      printf '%s' $tty
    else
      # is a terminal/pty
      printf '%s' (prompt_hostname)
    end
  else
    # no nested tmux
    return 1
  end
end

function __tmux_auto_launch --on-event fish_startup
  set session (__tmux_session_name); or return

  if not tmux has-session -t $session &>/dev/null
    tmux new -s $session
{'fraction_non_alphanumeric': 0.10816777041942605, 'fraction_numerical': 0.004415011037527594, 'mean_word_length': 2.8526912181303117, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3734828', 'n_tokens_mistral': 489, 'n_tokens_neox': 478, 'n_words': 155}