Skip to content

Commit

Permalink
fix: terminal args parsing + default mac/linux args
Browse files Browse the repository at this point in the history
  • Loading branch information
NGPixel committed Feb 17, 2025
1 parent 36a3259 commit 7b25012
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src-electron/terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const defaultShell = {
switch (os.platform()) {
case 'darwin':
defaultShell.cmd = 'zsh'
defaultShell.args = ''
defaultShell.args = '-i'
break
case 'win32':
defaultShell.cmd = 'pwsh.exe'
Expand All @@ -23,7 +23,7 @@ export default {
*/
initialize (mainWindow, opts = {}) {
if (this.term) { return }
this.term = pty.spawn(opts.shell || defaultShell.cmd, (opts.args ?? defaultShell.args).split(' '), {
this.term = pty.spawn(opts.shell || defaultShell.cmd, (opts.args ?? defaultShell.args).split(' ').filter(a => a), {
name: 'draftforge-terminal',
cols: 80,
rows: 30,
Expand Down
4 changes: 2 additions & 2 deletions src/stores/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { decorationsStore } from 'src/stores/models'

const defaultShell = {
cmd: 'bash',
args: ''
args: '-i'
}
switch (process.env.OS_PLATFORM) {
case 'darwin':
defaultShell.cmd = 'zsh'
defaultShell.args = ''
defaultShell.args = '-i'
break
case 'win32':
defaultShell.cmd = 'pwsh.exe'
Expand Down

0 comments on commit 7b25012

Please sign in to comment.