summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-10-18 10:25:29 +0300
committerIgor Soarez <igor@soarez.org>2026-10-18 10:25:29 +0300
commitdb0e9cc4660fcd36a0b729cc53931c318ee0369f (patch)
tree679283b58acb21146ce4f6e86eef86335a1f1a66 /bin
parent95056eacdff97a710129bbb29e707ab83f5faa72 (diff)
alacritty-mosh: unique per-launch config paths
The per-target files in /tmp/alacritty were deleted by the session's cleanup trap, so a second window to the same host (or a relaunch racing a previous exit) lost its config mid-flight and Alacritty logged "Unable to load config ... File not found" on live reload. Suffix the paths with the launcher PID so each instance owns its own files.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/alacritty-mosh6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/alacritty-mosh b/bin/alacritty-mosh
index 6032828..e6941ae 100755
--- a/bin/alacritty-mosh
+++ b/bin/alacritty-mosh
@@ -4,8 +4,10 @@ set -euo pipefail
target="$1"
dedicated_dir='/tmp/alacritty'
-dedicated_cfg="${dedicated_dir}/$target.conf"
-dedicated_sh="${dedicated_dir}/${target}.sh"
+# Unique per launch: cleanup deletes the files when the session inside ends,
+# so a second window (or a relaunch racing a previous exit) must not share them.
+dedicated_cfg="${dedicated_dir}/${target}.$$.conf"
+dedicated_sh="${dedicated_dir}/${target}.$$.sh"
mkdir -p "${dedicated_dir}"
main_cfg="${HOME}/.config/alacritty/alacritty.toml"