Skip to content

Instantly share code, notes, and snippets.

@baldwindavid
Created October 26, 2025 18:37
Show Gist options
  • Save baldwindavid/6a8fab810adb30670e8e39e0d9312669 to your computer and use it in GitHub Desktop.
Save baldwindavid/6a8fab810adb30670e8e39e0d9312669 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Generic wrapper to run a command in the pane below the current one
# Usage: run_in_terminal_pane.sh <command> [args...]
# Assumes you're using the dev layout with a terminal pane below
HELIX_CWD="$(pwd)"
# Build the full command to run
full_command="$@"
# Move down to the terminal pane
zellij action move-focus down
# Write command to the now-focused pane
zellij action write-chars "cd '$HELIX_CWD' && $full_command"
zellij action write 13 # Send enter key (ASCII 13)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment