allow specifying a custom startup directory (fixes #223)

This commit is contained in:
Eugene Pankov
2017-10-23 21:54:40 +02:00
parent 33f67503bd
commit 8d12d6a547
4 changed files with 54 additions and 36 deletions

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