Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/main
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ if [[ "$is_root_of_repo" -eq 0 ]]; then
directory="../$directory"
fi

window_name=$(echo "$directory" | sed 's/\.\.\///g' | sed 's/-/ /g')

if [[ -d "$directory" ]]; then
abs_directory=$(cd "$directory" && pwd)
if ! tmux new-window -c "$abs_directory" -n "$directory"; then
if ! tmux new-window -c "$abs_directory" -n "$window_name"; then
echo "Error: Failed to create tmux window"
read -n 1 -s -r -p "Press any key to close..."
exit 1
Expand All @@ -108,7 +110,7 @@ else
fi

abs_directory=$(cd "$directory" && pwd)
if ! tmux new-window -c "$abs_directory" -n "$directory"; then
if ! tmux new-window -c "$abs_directory" -n "$window_name"; then
echo "Error: Failed to create tmux window"
read -n 1 -s -r -p "Press any key to close..."
exit 1
Expand Down