windows release支持

This commit is contained in:
yonglin
2026-09-17 16:16:44 +08:00
parent 36d60bab1e
commit b9098ece5c
6 changed files with 100 additions and 62 deletions
+22
View File
@@ -0,0 +1,22 @@
import { describe, expect, it } from 'vitest'
import { resolveLocalShell } from '../src/main/session/LocalBackend'
describe('local shell selection', () => {
it('uses ComSpec without Unix login arguments on Windows', () => {
expect(resolveLocalShell('win32', { ComSpec: 'C:\\Windows\\System32\\cmd.exe' })).toEqual({
shell: 'C:\\Windows\\System32\\cmd.exe',
args: [],
})
})
it('falls back to cmd.exe when ComSpec is unavailable', () => {
expect(resolveLocalShell('win32', {})).toEqual({ shell: 'cmd.exe', args: [] })
})
it('keeps the login-shell behaviour on Unix platforms', () => {
expect(resolveLocalShell('linux', { SHELL: '/bin/zsh' })).toEqual({
shell: '/bin/zsh',
args: ['-l'],
})
})
})