Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

support platform-dependent 'shell' and 'shellArguments' options #66

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions lib/status-bar.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@ class StatusBar extends View
event.originalEvent.dataTransfer.setData 'platformio-ide-terminal-tab', 'true'
pane.onDidDestroy -> tabBar.off 'drop', @onDropTabBar

getPlatformName: ->
name = window.navigator.platform.toLowerCase()
if name.startsWith('mac')
return 'mac'
else if name.startsWith('win') or name.startsWith('(win')
return 'windows'
else
return name

createTerminalView: (autoRun) ->
@registerPaneSubscription() unless @paneSubscription?

Expand All @@ -168,8 +177,14 @@ class StatusBar extends View
id = editorPath or projectFolder or home
id = filePath: id, folderPath: path.dirname(id)

shell = atom.config.get 'platformio-ide-terminal.core.shell'
shellArguments = atom.config.get 'platformio-ide-terminal.core.shellArguments'
platformName = @getPlatformName()
shell = atom.config.get 'platformio-ide-terminal.core.' + platformName + '.shell'
shellArguments = atom.config.get 'platformio-ide-terminal.core.' + platformName + '.shellArguments'

if shell == undefined
shell = atom.config.get 'platformio-ide-terminal.core.shell'
if shellArguments == undefined
shellArguments = atom.config.get 'platformio-ide-terminal.core.shellArguments'
args = shellArguments.split(/\s+/g).filter (arg) -> arg

statusIcon = new StatusIcon()
Expand Down