@volter/supercode-terminal 0.2.31 → 0.2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -3
- package/substrate/tmux.js +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-terminal",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.33",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Optional leak-safe terminal and tmux host adapter for Volter Harness frontends",
|
|
6
6
|
"exports": {
|
|
@@ -90,8 +90,7 @@
|
|
|
90
90
|
],
|
|
91
91
|
"scripts": {
|
|
92
92
|
"build": "npm run build:substrate && node scripts/build.mjs",
|
|
93
|
-
"
|
|
94
|
-
"prepack": "npm test",
|
|
93
|
+
"prepack": "npm run build",
|
|
95
94
|
"build:substrate": "tsc -p tsconfig.substrate.json"
|
|
96
95
|
},
|
|
97
96
|
"peerDependencies": {
|
package/substrate/tmux.js
CHANGED
|
@@ -312,8 +312,14 @@ async function declareSessionColorEnvironmentAsync(socket) {
|
|
|
312
312
|
// A supercode pane (p_*) that ends leaves one line in the pane-exit log: its exit
|
|
313
313
|
// status or signal when it failed (the session keeps a failed pane just long
|
|
314
314
|
// enough for tmux to report it, then closes it), `closed` when it ended cleanly.
|
|
315
|
+
// The pane-died hook acts on the pane that died, named by `#{hook_pane}`, and on
|
|
316
|
+
// nothing else: when its session is already gone (a close kills the session, then
|
|
317
|
+
// its processes), tmux resolves an untargeted `kill-pane` and `#{session_name}` to
|
|
318
|
+
// the most recently used session instead, and that session's program was killed.
|
|
319
|
+
// Targets are not expanded as formats, so the shell that run-shell starts resolves
|
|
320
|
+
// the pane and does nothing when it no longer belongs to a p_* session.
|
|
315
321
|
const PANE_EXIT_LOG = '"${SUPERCODE_HOME:-$HOME/.config/supercode}/pane-exits.log"';
|
|
316
|
-
const PANE_DIED_HOOK = "
|
|
322
|
+
const PANE_DIED_HOOK = "run-shell 'p=\"#{hook_pane}\"; t() { tmux -S \"#{socket_path}\" \"$@\"; }; s=$(t display -p -t \"$p\" \"##{session_name}\" 2>/dev/null) || exit 0; case \"$s\" in p_*) ;; *) exit 0 ;; esac; printf \"%s %s died status=%s signal=%s\\n\" \"$(date +%FT%T)\" \"$s\" \"$(t display -p -t \"$p\" \"##{pane_dead_status}\")\" \"$(t display -p -t \"$p\" \"##{pane_dead_signal}\")\" >> " + PANE_EXIT_LOG + "; t kill-pane -t \"$p\"'";
|
|
317
323
|
const SESSION_CLOSED_HOOK = "if-shell -F '#{m:p_*,#{hook_session_name}}' { run-shell 'printf \"%s %s closed\\n\" \"$(date +%FT%T)\" \"#{hook_session_name}\" >> " + PANE_EXIT_LOG + "' }";
|
|
318
324
|
function sessionServerOptionArgs() {
|
|
319
325
|
return [
|