-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from hwixley/feature/shell-multiplex
GPT-commit: Added 'sys.dependencies.installed()' function, updated de…
- Loading branch information
Showing
3 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# Check if tmux is installed | ||
if ! sys.dependencies.installed "tmux"; then | ||
echo "You need to install tmux to use this command." | ||
exit 1 | ||
fi | ||
|
||
# Check if at least one command is provided | ||
if [ "$#" -lt 1 ]; then | ||
echo "You need to provide at least one command." | ||
exit 1 | ||
fi | ||
|
||
# Create a new tmux session named "my_session" | ||
SESSION="my_session" | ||
tmux new-session -d -s $SESSION | ||
|
||
# Create the first window and run the first command | ||
tmux send-keys "$1" C-m | ||
|
||
# Create additional panes for each command | ||
for i in $(seq 2 $#); do | ||
tmux split-window -t $SESSION -h | ||
tmux select-layout -t $SESSION tiled | ||
tmux send-keys "${!i}" C-m | ||
done | ||
|
||
# Adjust the layout to tiled | ||
tmux select-layout -t $SESSION tiled | ||
|
||
# Attach to the tmux session | ||
tmux attach-session -t $SESSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters