<commit_before># I always want to be in a Tmux session. Always.
#
# This creates a single always-running "login" session, and creates
# new session as needed that are bound to "login"'s window group.
# This lets me have a different terminals tabs/windows have the same tmux
# windows but be looking at different ones individually

# If we aren't in Tmux, set it up
if [ -z "$TMUX" ]; then
  if which tmux 2>&1 >/dev/null; then
    if [ -z "$(tmux ls | grep 'login:')" ]; then
      tmux new-session -d -s login # Create a detached session called login
      tmux new-session -t login    # Create a *new* session bound to the same windows
    else
      last_session="$(tmux list-windows -t login | tail -n1 | cut -d: -f1)"
      tmux new-session -t login \; new-window -a -t $last_session # Create a *new* session bound to "login" and create a new window
    fi

    # When Tmux exits, we exit
    exit
  fi
fi<commit_msg>Don't kill the shell when tmux exits if "/tmp/keep-shell" exists.<commit_after># I always want to be in a Tmux session. Always.
#
# This creates a single always-running "login" session, and creates
# new session as needed that are bound to "login"'s window group.
# This lets me have a different terminals tabs/windows have the same tmux
# windows but be looking at different ones individually

# If we aren't in Tmux, set it up
if [ -z "$TMUX" ]; then
  if which tmux 2>&1 >/dev/null; then
    if [ -z "$(tmux ls | grep 'login:')" ]; then
      tmux new-session -d -s login # Create a detached session called login
      tmux new-session -t login    # Create a *new* session bound to the same windows
    else
      last_session="$(tmux list-windows -t login | tail -n1 | cut -d: -f1)"
      tmux new-session -t login \; new-window -a -t $last_session # Create a *new* session bound to "login" and create a new window
    fi

    # When Tmux exits, we exit. Unless we want to keep the shell
    if [[ -f "/tmp/keep-shell" ]]; then
      rm "/tmp/keep-shell"
    else
      exit
    fi
  fi
fi
{'fraction_non_alphanumeric': 0.09826302729528535, 'fraction_numerical': 0.003970223325062035, 'mean_word_length': 2.825426944971537, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2916608', 'n_tokens_mistral': 638, 'n_tokens_neox': 611, 'n_words': 301}