dsh-open-in-dsh 0.3.2 → 0.3.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-open-in-dsh",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -122,11 +122,21 @@ bundle_executable() {
122
122
  # Desktop Beta 2.0.18-beta.1, pgrep -f sees every helper and crash-reporting
123
123
  # process of the app but *not* the packaged main process, so a running app read
124
124
  # as "closed" and every click would take the cold-start path. `ps -ww` prints
125
- # the untruncated command line, and an exact match keeps helpers (which carry
126
- # extra arguments) out.
125
+ # the untruncated command line.
126
+ #
127
+ # The match is a prefix match, not an exact one. The packaged main process now
128
+ # carries arguments: an auto-update relaunches it as `<exe> --updated` (DSH
129
+ # Desktop Beta 2.0.23-beta.1, measured 2026-11-14), and the host it spawns is
130
+ # `<exe> --expose-internals … host.js …`. An exact match read a just-updated
131
+ # app as closed, so *every* click took the cold-start path — which is why the
132
+ # cold-start-only `socket_ready` bug surfaced right after each update. Helper
133
+ # processes live under `Contents/Frameworks/… Helper.app/`, a different prefix,
134
+ # so they still never match.
127
135
  is_running() {
128
136
  [ -n "$1" ] || return 1
129
- ps -ww -Ao command= 2>/dev/null | grep -Fx -- "$1" >/dev/null 2>&1
137
+ ps -ww -Ao command= 2>/dev/null | awk -v exe="$1" '
138
+ index($0, exe) == 1 && (length($0) == length(exe) || substr($0, length(exe) + 1, 1) == " ") { found = 1 }
139
+ END { exit found ? 0 : 1 }'
130
140
  }
131
141
 
132
142
  # A running instance always wins: the click is meant for the DSH the user is