-
Hi, I have a script shell script that let's me choose a directory from a list of directories. It then checks if there is a workspace for the chosen directory and if not creates a new workspace for it. However, in any case I want to immediately switch to the newly (or not) created workspace. Can I achieve this using #!/bin/sh
if [ "$#" -eq 1 ]; then
project="$1"
else
project=`fdfind -L --min-depth=1 --max-depth=1 -t directory . ~/work ~/.config | fzf`
fi
[ -z "$project" ] && exit 0
workspace=$(basename "$project")
workspace_dir="$project"
if wezterm cli list | awk '{ print $4 }' | grep -iq "$workspace"; then
echo "workspace already exists"
# TODO switch to new workspace
else
echo "workspace does not exist"
wezterm cli spawn --new-window --cwd "$workspace_dir" --workspace "$workspace"
# TODO switch to new workspace
fi |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
There isn't a built-in way to do this (please file an enhancement issue!), but take a look at:
|
Beta Was this translation helpful? Give feedback.
-
Thanks, will do! |
Beta Was this translation helpful? Give feedback.
There isn't a built-in way to do this (please file an enhancement issue!), but take a look at:
for a way to pass data to the gui from a pane running inside wezterm