Merge branch 'master' of github.com:Eugeny/terminus

This commit is contained in:
Eugene Pankov
2017-11-16 22:49:23 +01:00
8 changed files with 108 additions and 7 deletions

View File

@@ -247,6 +247,15 @@ h3.mt-2.mb-2 Behaviour
(ngModelChange)='config.save()',
)
.form-group
label Working directory
input.form-control(
type='text',
placeholder='Home directory',
'[(ngModel)]'='config.store.terminal.workingDirectory',
(ngModelChange)='config.save()',
)
.form-group
label Auto-open a terminal on app start
br
@@ -270,7 +279,6 @@ h3.mt-2.mb-2 Behaviour
)
| On
.col-md-6
.d-flex
.form-group.mr-3
label Terminal bell

View File

@@ -15,6 +15,7 @@ export class TerminalConfigProvider extends ConfigProvider {
customShell: '',
rightClick: 'menu',
copyOnSelect: false,
workingDirectory: '',
colorScheme: {
__nonStructural: true,
name: 'Material',

View File

@@ -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()

View File

@@ -25,7 +25,10 @@ export class WSLShellProvider extends ShellProvider {
return [{
id: 'wsl',
name: 'Bash on Windows',
command: wslPath
command: wslPath,
env: {
TERM: 'xterm-color',
}
}]
}
}