### Install shpool with systemd Source: https://github.com/shell-pool/shpool/blob/master/README.md Installs the shpool service and configures systemd to manage it as a user service. This involves downloading the service and socket files, enabling them, and starting the service. It also ensures the user has lingering enabled. ```shell cargo install shpool curl -fLo "${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user/shpool.service" --create-dirs https://raw.githubusercontent.com/shell-pool/shpool/master/systemd/shpool.service sed -i "s|/usr|$HOME/.cargo|" "${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user/shpool.service" curl -fLo "${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user/shpool.socket" --create-dirs https://raw.githubusercontent.com/shell-pool/shpool/master/systemd/shpool.socket systemctl --user enable shpool systemctl --user start shpool loginctl enable-linger ``` -------------------------------- ### shpool Configuration File Example Source: https://context7.com/shell-pool/shpool/llms.txt Example TOML configuration file for shpool, located at `~/.config/shpool/config.toml`. It demonstrates options for customizing prompt prefixes, session restore modes, default directories, shell overrides, environment variables, and output history. ```toml # ~/.config/shpool/config.toml # Customize the prompt prefix shown in shpool sessions # Use $SHPOOL_SESSION_NAME for the session name prompt_prefix = "[$SHPOOL_SESSION_NAME]" # Or disable prompt prefix entirely: # prompt_prefix = "" # Session restore mode when reattaching # "screen" - restore a screenful of history (default) # "simple" - only trigger SIGWINCH for ncurses apps # { lines = n } - restore last n lines of history session_restore_mode = "screen" # session_restore_mode = { lines = 100 } # Default starting directory for new sessions # "$HOME" - user's home directory (default) # "." - directory where shpool attach was invoked default_dir = "$HOME" # Override the user's default shell shell = "/usr/bin/zsh" # Environment variables to inject into new shells [env] EDITOR = "vim" PAGER = "less" # Forward environment variables from attach process to shell forward_env = ["DISPLAY", "SSH_AUTH_SOCK", "TERM"] # Number of lines to keep in output history (default: 10000) output_spool_lines = 10000 ``` -------------------------------- ### Install shpool with Systemd Support Source: https://context7.com/shell-pool/shpool/llms.txt Installs shpool using cargo and configures systemd user service files for daemon management. This involves downloading service and socket files, adjusting paths, and enabling/starting the service. ```bash # Install shpool from crates.io cargo install shpool # Download and configure systemd service files curl -fLo "${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user/shpool.service" --create-dirs \ https://raw.githubusercontent.com/shell-pool/shpool/master/systemd/shpool.service sed -i "s|/usr|$HOME/.cargo|" "${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user/shpool.service" curl -fLo "${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user/shpool.socket" --create-dirs \ https://raw.githubusercontent.com/shell-pool/shpool/master/systemd/shpool.socket # Enable and start the service systemctl --user enable shpool systemctl --user start shpool loginctl enable-linger ``` -------------------------------- ### Set shpool Default Initial Directory Source: https://github.com/shell-pool/shpool/blob/master/CONFIG.md Configures the default directory where shpool starts a new shell session. Users can specify a path or use '.' to start in the directory where 'shpool attach' is invoked. ```toml default_dir = "/path/to/default-dir" ``` ```toml default_dir = "." ``` -------------------------------- ### Install Rust Toolchain and Set PATH Source: https://github.com/shell-pool/shpool/blob/master/HACKING.md Installs a Rust toolchain using rustup and configures the system's PATH to include cargo binaries. Ensures the minimum required Rust version (1.74.0) is met. ```shell #!/bin/bash # Ensure rustup is installed and up-to-date curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # Add cargo bin directory to PATH source "$HOME/.cargo/env" # Verify rust version if ! rustc --version | grep -q "1.74.0"; then echo "Rust version 1.74.0 or higher is required." rustup update fi ``` -------------------------------- ### Build and Install shpool from Source Source: https://github.com/shell-pool/shpool/blob/master/HACKING.md Compiles the shpool project in release mode and copies the executable to the user's cargo bin directory. This allows the shpool binary to be run from the command line. ```shell # Build shpool in release mode cargo build --release # Copy the executable to cargo's bin directory cp target/release/shpool ~/.cargo/bin/shpool ``` -------------------------------- ### List shpool Sessions Source: https://context7.com/shell-pool/shpool/llms.txt Lists all currently running shpool sessions, displaying their names, start times, and connection status. Supports both human-readable table format and detailed JSON output. ```bash # List sessions in table format shpool list # Output: # NAME STARTED_AT STATUS # main 2024-01-15T10:30:00+00:00 connected # dev 2024-01-15T09:00:00+00:00 disconnected # List sessions in JSON format (includes additional metadata) shpool list --json # Output: # { # "sessions": [ # { # "name": "main", # "started_at_unix_ms": 1705314600000, # "status": "connected" # } # ] # } ``` -------------------------------- ### Install shpool without systemd Source: https://github.com/shell-pool/shpool/blob/master/README.md Installs the shpool binary using cargo. This method is for users who do not use systemd and prefer to manage the shpool daemon manually or via other init systems. Autodaemonization is enabled by default. ```shell cargo install shpool ``` -------------------------------- ### Install and Enable shpool Systemd User Service Source: https://github.com/shell-pool/shpool/blob/master/HACKING.md Sets up shpool to run as a user-level systemd service using provided service and socket unit files. This enables automatic startup and management of the shpool daemon. ```shell # Create systemd user configuration directory if it doesn't exist mkdir -p ~/.config/systemd/user # Copy systemd unit files to the user configuration directory cp systemd/* ~/.config/systemd/user # Enable the shpool service to start on login systemctl --user enable shpool # Start the shpool service immediately systemctl --user start shpool ``` -------------------------------- ### Attach to shpool Sessions Source: https://context7.com/shell-pool/shpool/llms.txt Commands to create new named shell sessions or attach to existing ones. Supports options for forcing attachment, setting time-to-live, specifying custom commands, and defining starting directories. ```bash # Create or attach to a session named "main" shpool attach main # Force attach (detaches any existing terminal first) shpool attach -f main # Create session with a time-to-live (auto-kill after duration) shpool attach --ttl 3d work # Kill after 3 days shpool attach --ttl 10:45:00 temp # Kill after 10 hours 45 minutes # Start session with a custom command instead of default shell shpool attach -c "python3" python-session # Start session in a specific directory shpool attach -d /path/to/project dev shpool attach -d . local # Use current directory ``` -------------------------------- ### shpool Session Management with fzf (Zsh) Source: https://github.com/shell-pool/shpool/wiki/Minimalist-shpool-GUI-with-fzf This Zsh function `shpool_choose` leverages fzf to provide an interactive interface for selecting, attaching, creating, and killing shpool sessions. It includes keybindings for common operations and a preview window to display session details. Ensure fzf is installed and up-to-date. ```zsh # Shortcut: # ctrl+a then w to open the shpool session selector # ctrl+a then d to detach the current shpool session # ctrl+a then c to create a new shpool session # keybindings: # k/x to kill # a/enter to attach # ctrl+r to reload list shpool_choose() { if [ -z "$SHPOOL_SESSION_NAME" ] then cur_sess="" list_cmd="shpool list | tail -n +2 | cut -f1" else cur_sess=" (current: '$SHPOOL_SESSION_NAME')" list_cmd="shpool list | tail -n +2 | cut -f1 | \grep -v $SHPOOL_SESSION_NAME" fi cmd_output=$( eval "$list_cmd" | fzf \ --bind "k:reload-sync(shpool kill {} ; $list_cmd)" \ --bind "x:reload-sync(shpool kill {} ; $list_cmd)" \ --bind "a:execute(shpool attach --force {})" \ --bind "ctrl-r:reload-sync($list_cmd)" \ --preview 'shpool list | grep {1}' \ --bind "change:reload($list_cmd)" \ --reverse \ --height=~100% \ --preview-window down:wrap \ --header "Shpool sessions$cur_sess" \ --no-select-1 \ --no-info \ --cycle \ --no-exit-0 ) || return # query is what is entered by the user, it's always present query=$(echo "$cmd_output" | head -n 1) # selection is the lines after query, that are only here if some sessions matched the query selection=$(echo "$cmd_output" | tail -n +2) if [ "$selection" ] then # notify-send "SEL $selection" shpool attach --force $selection return else # notify-send "NOSEL: $cmd_output" shpool attach --force $query return fi } bindkey -s "^aw" 'shpool_choose\n' bindkey -s "^ad" 'shpool detach\n' alias shpool_create='shpool attach -f "$(date +%m/%d_%H:%M:%S)"' bindkey -s "^ac" 'shpool_create\n' ``` -------------------------------- ### Configure shpool Dump Mode for MOTD Source: https://github.com/shell-pool/shpool/blob/master/CONFIG.md Sets the 'shpool' utility to display the message of the day (motd) inline when a new session is started. This mode does not show the motd when re-attaching to an existing session. ```shell motd = "dump" ``` -------------------------------- ### Set shpool Detach Keybinding Source: https://github.com/shell-pool/shpool/blob/master/CONFIG.md Allows users to configure a custom keybinding for detaching from a shpool session. The default is Ctrl-Space Ctrl-q. This example shows how to set 'Ctrl-a d' as the detach keybinding. ```toml [[keybinding]] binding = "Ctrl-a d" action = "detach" ``` -------------------------------- ### Configure shpool Feature Flags (Shell) Source: https://context7.com/shell-pool/shpool/llms.txt Control various shpool features by setting boolean flags in configuration files. These flags determine whether specific functionalities like loading rc files or daemonizing are enabled. For example, setting `norc = false` ensures that shell rc files are loaded. ```shell # ~/.config/shpool/config.toml or similar norc = false # Don't load shell rc files (bash only) nosymlink_ssh_auth_sock = false # Don't symlink SSH_AUTH_SOCK noread_etc_environment = false # Don't read /etc/environment nodaemonize = false # Don't auto-spawn daemon ``` -------------------------------- ### Calling libshpool::run Source: https://github.com/shell-pool/shpool/blob/master/libshpool/README.md Demonstrates the basic integration pattern for calling the main `run` function from libshpool. This involves parsing arguments and executing the core logic. It assumes that version subcommands and re-execution handling are managed separately. ```rust use libshpool; fn main() { // Handle version subcommand manually // Call motd::handle_reexec() if using the motd crate let args = libshpool::Args::parse(); libshpool::run(args); } ``` -------------------------------- ### Use shpool as a Rust Library (Rust) Source: https://context7.com/shell-pool/shpool/llms.txt Demonstrates how to use the `libshpool` crate in Rust for programmatic control of shpool sessions. This includes parsing command-line arguments and running shpool, as well as programmatically constructing arguments to attach to a specific session with options like force, TTL, and directory. ```rust use libshpool::{Args, Commands, run}; fn main() -> anyhow::Result<()> { // Parse command line arguments let args = Args::parse(); // Check for version command if args.version() { println!("shpool {}", env!("CARGO_PKG_VERSION")); return Ok(()); } // Run shpool with parsed arguments and optional hooks run(args, None) } // Programmatically construct arguments fn attach_to_session() -> anyhow::Result<()> { let args = Args { log_file: Some("/tmp/shpool.log".to_string()), verbose: 1, socket: None, config_file: None, daemonize: false, no_daemonize: false, command: Commands::Attach { force: true, ttl: Some("1d".to_string()), cmd: None, dir: Some( കി。".to_string()), name: "dev".to_string(), }, __non_exhaustive: (), }; run(args, None) } ``` -------------------------------- ### Record and Replay Executions with rr for Debugging Source: https://github.com/shell-pool/shpool/blob/master/HACKING.md This section details how to use the 'rr' tool for debugging by recording and replaying program executions. It covers building a test binary, recording a trace, and replaying it with a debugger, including how to inspect subprocesses by their PIDs. ```shell $ cargo test --test --no-run ``` ```shell $ SHPOOL_LEAVE_TEST_LOGS=true rr ./path/to/test/exe --nocapture ``` ```shell $ rr ps ``` ```shell $ rr replay --debugger=rust-gdb --onprocess= ``` -------------------------------- ### Configure shpool to avoid shell hangs with interactive startup scripts Source: https://github.com/shell-pool/shpool/wiki/Troubleshooting If `shpool attach` hangs when launching a new shell due to interactive elements in your shell's startup files (e.g., `.bashrc`), set `prompt_prefix = ""` in your shpool configuration. This bypasses the expectation that the shell will behave as a fully interactive shell on initial launch. ```toml prompt_prefix = "" ``` -------------------------------- ### Configure Custom Keybindings (TOML) Source: https://context7.com/shell-pool/shpool/llms.txt Define custom keybindings for shpool actions using TOML configuration. This allows users to override default key combinations for actions like detaching from a session. The syntax supports single keys, Ctrl combinations, and sequences. ```toml # ~/.config/shpool/config.toml # Change detach keybinding from default Ctrl-Space Ctrl-q [[keybinding]] binding = "Ctrl-a d" action = "detach" ``` -------------------------------- ### Configure shpool initial PATH value Source: https://github.com/shell-pool/shpool/wiki/Troubleshooting The initial PATH in shpool defaults to `/usr/bin:/bin:/usr/sbin:/sbin`. You can change this using the `initial_path` configuration variable in `~/.config/shpool/config.toml`. Alternatively, to inherit the PATH from your local shell, include `PATH` in the `forward_env` list in your configuration. ```toml initial_path = "/usr/local/bin:/usr/bin:/bin" ``` ```toml forward_env = ["PATH"] ``` -------------------------------- ### Format Code with nightly Rustfmt Source: https://github.com/shell-pool/shpool/blob/master/HACKING.md Ensures the codebase adheres to the project's style guidelines by running the nightly version of rustfmt. This command formats all Rust code files in the project. ```shell cargo +nightly fmt ``` -------------------------------- ### Configure Message of the Day (MOTD) Display (TOML) Source: https://context7.com/shell-pool/shpool/llms.txt Customize how shpool displays the Message of the Day (MOTD). Options include never showing it, dumping it inline when new sessions are created, or displaying it through a pager program like 'less'. You can also configure display frequency. ```toml # ~/.config/shpool/config.toml # Never show MOTD (default) motd = "never" # Dump MOTD inline when creating new sessions motd = "dump" # Display MOTD in a pager program [motd.pager] bin = "less" # Optional: only show MOTD if not shown within duration show_every = "1d" # Show at most once per day ``` -------------------------------- ### Configure shpool Session Restore Mode Source: https://github.com/shell-pool/shpool/blob/master/CONFIG.md Defines how shpool restores terminal output when re-attaching to an existing session. Options include 'screen' (default, redraws screen content), 'simple' (asks child processes to redraw), and '{ lines = n }' (restores the last n lines of history). ```toml session_restore_mode = "screen" ``` ```toml session_restore_mode = "simple" ``` ```toml session_restore_mode = { lines = n } ``` -------------------------------- ### Customize shpool Prompt Prefix Source: https://github.com/shell-pool/shpool/blob/master/CONFIG.md Allows customization of the prompt prefix injected by shpool into supported shells. Users can set a specific string or an empty string to disable injection. This configuration is done within the shpool configuration file. ```toml prompt_prefix = "[$SHPOOL_SESSION_NAME]" ``` ```toml prompt_prefix = "" ``` -------------------------------- ### Configure shpool Pager Mode for MOTD Source: https://github.com/shell-pool/shpool/blob/master/CONFIG.md Configures 'shpool' to use a specified pager program (e.g., 'less') to display the message of the day. The pager must accept a filename as its first argument. shpool launches the pager in a pseudo-terminal (pty) and waits for it to exit. ```shell [motd.pager] bin = "less" ``` -------------------------------- ### List shpool Sessions Source: https://github.com/shell-pool/shpool/blob/master/README.md Lists all currently active shell sessions managed by shpool. ```shell shpool list ``` -------------------------------- ### Customize Bash Prompt with PROMPT_COMMAND Source: https://github.com/shell-pool/shpool/wiki/Manual-Prompt-Annotation This bash script demonstrates how to override the default PROMPT_COMMAND to create a custom prompt. It injects the shpool session name and colors the prompt green or red based on the exit status of the last command. This offers more flexibility than the standard `prompt_prefix` option. ```bash function __prompt_command() { local EXIT="$?" # This needs to be first PS1="" local RCol='\[\e[0m\]' local Red='[\e[0;31m]' local Gre='[\e[0;32m]' if [ $EXIT != 0 ]; then PS1+="${Red}" else PS1+="${Gre}" fi if [ -v SHPOOL_SESSION_NAME ]; then PS1+="shpool:${SHPOOL_SESSION_NAME}" fi PS1+="$ ${RCol}" } export PROMPT_COMMAND=__prompt_command ``` -------------------------------- ### Create Shell Function for SSH + shpool Integration (Bash/Zsh) Source: https://context7.com/shell-pool/shpool/llms.txt A helper shell function to simplify connecting to shpool sessions on remote machines via SSH. This function takes the remote machine and session name as arguments and constructs the appropriate SSH command. It ensures the `-t` option is used for TTY allocation. ```bash # Add to ~/.bashrc or ~/.zshrc function shpool-ssh () { if [ $# -ne 2 ] ; then echo "usage: shpool-ssh " >&2 return 1 fi ssh -t "-oRemoteCommand=shpool attach -f $2" "$1" } # Usage: # shpool-ssh remote.host.example.com main # shpool-ssh server.local dev ``` -------------------------------- ### Configure SSH for Automatic shpool Session Attachment (SSH Config) Source: https://context7.com/shell-pool/shpool/llms.txt Set up SSH client configuration to automatically attach to shpool sessions on remote hosts. This allows connecting to named sessions (e.g., `ssh main`) or TTY-based sessions using `ssh by-tty`. The `RemoteCommand` directive is used to invoke `shpool attach`. ```sshconfig # ~/.ssh/config on client machine # Named session hosts - connect with: ssh main Host = main edit dev Hostname remote.host.example.com RemoteCommand shpool attach -f %k RequestTTY yes # TTY-based sessions - connect with: ssh by-tty Host = by-tty User remoteuser Hostname remote.host.example.com RemoteCommand shpool attach -f "ssh-$(basename $(tty))" RequestTTY yes ``` -------------------------------- ### Attach to a shpool session Source: https://github.com/shell-pool/shpool/blob/master/README.md Connects to a named shpool session. If the session does not exist, it will be created. This is the primary command for re-attaching to a persistent session after a disconnection. ```shell shpool attach main ``` -------------------------------- ### Configure shpool Message of the Day (MOTD) Display Source: https://github.com/shell-pool/shpool/blob/master/CONFIG.md Controls whether the message of the day is displayed when a user connects to a shpool session. The 'never' option disables MOTD display, which is the current default behavior. ```toml motd = "never" ``` -------------------------------- ### Configure bash for shpool Source: https://github.com/shell-pool/shpool/blob/master/README.md Ensures that child processes are terminated when the shell exits by setting the 'huponexit' option. This prevents orphaned processes from consuming resources within the shpool daemon's process tree. ```bash shopt -s huponexit ``` -------------------------------- ### Measure SSH Latency with sshping and shpool Source: https://github.com/shell-pool/shpool/blob/master/HACKING.md This snippet demonstrates how to measure end-to-end latency using the sshping tool, first for a raw SSH connection and then for a connection tunneled through shpool. It involves setting up a shpool session on the remote host and then using sshping with a command to attach to that session. ```shell sshping -H $REMOTE_HOST ``` ```shell sshping -H -e '/path/to/shpool attach -f sshping' $REMOTE_HOST ``` -------------------------------- ### SSH Config for Named shpool Sessions Source: https://github.com/shell-pool/shpool/blob/master/README.md Defines SSH host entries in ~/.ssh/config to automatically attach to named shpool sessions. The RemoteCommand uses shpool attach with a placeholder %k that expands to the host name. ```sshconfig Host = main edit Hostname remote.host.example.com RemoteCommand shpool attach -f %k RequestTTY yes ``` -------------------------------- ### Create shpool Session on SSH Login (Zsh) Source: https://github.com/shell-pool/shpool/wiki/Example:-always-create-a-shpool-session-when-using-SSH This Zsh script automatically creates a new shpool session upon SSH login if one does not already exist. It iterates through session names 'a' to 'z' to find an available slot. Dependencies include 'shpool' and 'notify-send'. ```zsh ## directly checks if it should start a tmux session to avoir running the entire zshrc twice if [[ "$ZSH_ARGZERO" == *"zsh" ]] # don't create a shpool is an argument was given to zsh then # create a new shpool session $(printenv | grep -q '^SHPOOL_SESSION_NAME=') || { # if we're not already in a shpool session { sessions=$(shpool list | tail -n +2 | cut -f1) for letter in {a..z} # sessions are named a through z to be easy to type on termux, as shpool has no autocomplete do $(echo "$sessions" | grep -q "$letter") || { # notify-send "Creating shpool session $letter" shpool attach "$letter" || notify-send "Error creating shpool session" break # we could logout here too } done } || { notify-send -u critical "Error creating shpool session" ; echo "Error creating shpool session" } } $(printenv | grep -q '^SHPOOL_SESSION_NAME=') && { echo "Using shpool session $SHPOOL_SESSION_NAME" } fi ``` -------------------------------- ### Source Forwarded Environment Variables in Bash Source: https://github.com/shell-pool/shpool/wiki/Picking-up-forwarded-env-vars-on-reattach This snippet demonstrates how to source the environment variables forwarded by shpool in a bash shell. It reads the variables from the `forward.env` file located in the shpool session directory. ```bash source $SHPOOL_SESSION_DIR/forward.env ``` -------------------------------- ### Attach to shpool Session Source: https://github.com/shell-pool/shpool/blob/master/README.md Connects to a shpool daemon instance. If the session name is new, a new shell is created. If it exists, it attaches to the existing session if no other terminal is connected. The --ttl flag limits session duration. ```shell shpool attach shpool attach -f shpool attach --ttl ``` -------------------------------- ### Detach from shpool Sessions Source: https://context7.com/shell-pool/shpool/llms.txt Detaches from one or more shpool sessions without terminating them. Sessions continue running in the background and can be reattached later. Detachment can be done from the current session or by specifying session names. ```bash # Detach from current session (when inside a shpool session) shpool detach # Detach specific sessions by name shpool detach main dev # Detach using keybinding (default: Ctrl-Space Ctrl-q) # Press Ctrl-Space, release, then press Ctrl-q ``` -------------------------------- ### SSH Config for TTY-Based shpool Sessions Source: https://github.com/shell-pool/shpool/blob/master/README.md Configures SSH to automatically create and attach to shpool sessions named after the local terminal's TTY number. It uses command substitution $(basename $(tty)) within the RemoteCommand. ```sshconfig Host = by-tty User remoteuser Hostname remote.host.example.com RemoteCommand shpool attach -f "ssh-$(basename $(tty))" RequestTTY yes ``` -------------------------------- ### Kill shpool Sessions Source: https://context7.com/shell-pool/shpool/llms.txt Terminates named shpool sessions completely. This action detaches any connected terminals and sends signals (SIGHUP, SIGKILL) to the underlying shell processes. Sessions can be killed individually or in batches. ```bash # Kill a specific session shpool kill main # Kill multiple sessions shpool kill dev temp work # Kill current session (when inside a shpool session) shpool kill ``` -------------------------------- ### Shell Function for SSH shpool Sessions Source: https://github.com/shell-pool/shpool/blob/master/README.md A custom shell function to simplify connecting to shpool sessions on a remote machine. It takes the remote machine and session name as arguments and uses ssh with a RemoteCommand to attach. ```bash function shpool-ssh () { if [ $# -ne 2 ] ; then echo "usage: shpool-ssh " >&2 return 1 fi ssh -t "-oRemoteCommand=shpool attach -f $2" "$1" } ``` -------------------------------- ### Workaround neovim resizing issues after reattach in shpool Source: https://github.com/shell-pool/shpool/wiki/Troubleshooting To address neovim not resizing properly after a reattach when using shpool, execute the following Lua command within neovim: `:lua io.stdout:write('\027[?2048h')`. This forces neovim to listen for terminal resize events, which shpool generates. ```vimscript :lua io.stdout:write('\027[?2048h') ``` -------------------------------- ### Kill shpool Session Source: https://github.com/shell-pool/shpool/blob/master/README.md Terminates a named shpool shell session. ```shell shpool kill ``` -------------------------------- ### Preserve shpool Test Logs with Environment Variable Source: https://github.com/shell-pool/shpool/blob/master/HACKING.md This snippet shows how to prevent shpool test logs from being automatically cleaned up. By setting the SHPOOL_LEAVE_TEST_LOGS environment variable to 'true', log files emitted by shpool subprocesses will be retained for later inspection. ```shell $ SHPOOL_LEAVE_TEST_LOGS=true cargo test --test attach happy_path -- --nocapture ``` -------------------------------- ### Detach from shpool Sessions Source: https://github.com/shell-pool/shpool/blob/master/README.md Detaches from one or more shpool sessions without terminating them. If run from within a shpool session without arguments, it detaches the current session. ```shell shpool detach shpool detach [ ...] ``` -------------------------------- ### Detach from a shpool session Source: https://github.com/shell-pool/shpool/blob/master/README.md Forces a named shpool session to detach. This is useful when a connection is stuck and the session is preventing reattachment. It allows you to forcefully disconnect from the current session. ```shell shpool detach main ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.