提交 8d12d6a5 编写于 作者: E Eugene Pankov

allow specifying a custom startup directory (fixes #223)

上级 33f67503
......@@ -247,6 +247,15 @@
(ngModelChange)='config.save()',
)
.form-group
label Working directory
input.form-control(
type='text',
placeholder='Home directory',
'[(ngModel)]'='config.store.terminal.workingDirectory',
(ngModelChange)='config.save()',
)
.d-flex
.form-group.mr-3
label Terminal bell
......@@ -301,37 +310,38 @@
)
| On
.form-group
label Session persistence
select.form-control(
'[(ngModel)]'='config.store.terminal.persistence',
(ngModelChange)='config.save()',
)
option([ngValue]='null') Off
option(
*ngFor='let provider of persistenceProviders',
[ngValue]='provider.id'
) {{provider.displayName}}
.d-flex
.form-group.mr-3(*ngIf='persistenceProviders.length > 0')
label Session persistence
select.form-control(
'[(ngModel)]'='config.store.terminal.persistence',
(ngModelChange)='config.save()',
)
option([ngValue]='null') Off
option(
*ngFor='let provider of persistenceProviders',
[ngValue]='provider.id'
) {{provider.displayName}}
.form-group
label Auto-open a terminal on app start
br
.btn-group(
'[(ngModel)]'='config.store.terminal.autoOpen',
(ngModelChange)='config.save()',
ngbRadioGroup
)
label.btn.btn-secondary(ngbButtonLabel)
input(
type='radio',
ngbButton,
[value]='false'
)
| Off
label.btn.btn-secondary(ngbButtonLabel)
input(
type='radio',
ngbButton,
[value]='true'
)
| On
.form-group
label Auto-open a terminal on app start
br
.btn-group(
'[(ngModel)]'='config.store.terminal.autoOpen',
(ngModelChange)='config.save()',
ngbRadioGroup
)
label.btn.btn-secondary(ngbButtonLabel)
input(
type='radio',
ngbButton,
[value]='false'
)
| Off
label.btn.btn-secondary(ngbButtonLabel)
input(
type='radio',
ngbButton,
[value]='true'
)
| On
......@@ -13,6 +13,7 @@ export class TerminalConfigProvider extends ConfigProvider {
cursor: 'block',
cursorBlink: true,
customShell: '',
workingDirectory: '',
colorScheme: {
__nonStructural: true,
name: 'Material',
......
......@@ -33,8 +33,12 @@ export class TerminalService {
}
async openTab (shell?: IShell, cwd?: string): Promise<TerminalTabComponent> {
if (!cwd && this.app.activeTab instanceof TerminalTabComponent) {
cwd = await this.app.activeTab.session.getWorkingDirectory()
if (!cwd) {
if (this.app.activeTab instanceof TerminalTabComponent) {
cwd = await this.app.activeTab.session.getWorkingDirectory()
} else {
cwd = this.config.store.terminal.workingDirectory || null
}
}
if (!shell) {
let shells = await this.shells$.toPromise()
......
......@@ -25,7 +25,10 @@ export class WSLShellProvider extends ShellProvider {
return [{
id: 'wsl',
name: 'Bash on Windows',
command: wslPath
command: wslPath,
env: {
TERM: 'xterm-color',
}
}]
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册