Last active
July 11, 2025 13:50
-
-
Save thefotios/ca47a93a785a68f11332157e3a4c0bad to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
### | |
# https://gist.github.com/thefotios/ca47a93a785a68f11332157e3a4c0bad | |
# | |
# zed doesn't handle waiting for directories | |
# See https://github.com/zed-dev/zed/issues/23347 | |
# | |
# This script checks to see if any of the arguments are | |
# directories and if so, creates a temporary file to wait for | |
# Thus tricking the mighty zed and saving the day! | |
#### | |
path=("${@}") | |
for item in "${path[@]}" | |
do | |
if [ -d "$item" ]; then | |
tmpfile=$(mktemp -t close-zed.XXXXX) | |
trap 'rm "$tmpfile"' EXIT | |
path+=("$tmpfile") | |
echo "Close this tab when done" > "$tmpfile" | |
break | |
fi | |
done | |
zed --wait "${path[@]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment