Skip to content

Commit

Permalink
fix: process name on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Sep 12, 2023
1 parent a6a0677 commit b5d0f0c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"file-icon": "^4.0.0",
"fuzzaldrin-plus": "^0.6.0",
"lodash": "^4.17.21",
"node-pty": "^1.0.0",
"node-pty": "^1.1.0-beta4",
"properties": "^1.2.1",
"semver": "^7.5.4",
"shell-history": "^1.1.0",
Expand Down
10 changes: 2 additions & 8 deletions src/main/lib/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ import { useSettings, whenSettingsReady } from './settings'

const ptyProcessMap = new Map<number, IPty>()

function readProcess(ptyProcess: IPty) {
const processName = ptyProcess.process
// FIXME: sometimes the `process` is a symbol
return typeof processName === 'string' ? processName : undefined
}

async function createTerminal(
webContents: WebContents,
{ shell, args, env, cwd }: Partial<TerminalContext>,
Expand Down Expand Up @@ -72,7 +66,7 @@ async function createTerminal(
if (!webContents.isDestroyed()) {
webContents.send('input-terminal', {
pid: ptyProcess.pid,
process: readProcess(ptyProcess) ?? shell,
process: ptyProcess.process,
data,
})
}
Expand All @@ -89,7 +83,7 @@ async function createTerminal(
ptyProcessMap.set(ptyProcess.pid, ptyProcess)
return {
pid: ptyProcess.pid,
process: readProcess(ptyProcess) ?? shell,
process: ptyProcess.process,
cwd,
shell,
args,
Expand Down

0 comments on commit b5d0f0c

Please sign in to comment.