1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-12-25 11:33:35 +03:00

fixed cwd detection for split tabs

This commit is contained in:
Eugene Pankov 2019-03-08 12:35:14 +01:00
parent e246e22bfd
commit 1a46f0ec3c

View File

@ -1,7 +1,7 @@
import * as fs from 'mz/fs'
import { Observable, AsyncSubject } from 'rxjs'
import { Injectable, Inject } from '@angular/core'
import { AppService, Logger, LogService, ConfigService } from 'terminus-core'
import { AppService, Logger, LogService, ConfigService, SplitTabComponent } from 'terminus-core'
import { IShell, ShellProvider, SessionOptions } from '../api'
import { TerminalTabComponent } from '../components/terminalTab.component'
import { UACService } from './uac.service'
@ -58,6 +58,13 @@ export class TerminalService {
if (this.app.activeTab instanceof TerminalTabComponent && this.app.activeTab.session) {
cwd = await this.app.activeTab.session.getWorkingDirectory()
}
if (this.app.activeTab instanceof SplitTabComponent) {
let focusedTab = this.app.activeTab.getFocusedTab()
if (focusedTab instanceof TerminalTabComponent && focusedTab.session) {
cwd = await focusedTab.session.getWorkingDirectory()
}
}
cwd = cwd || this.config.store.terminal.workingDirectory
cwd = cwd || null
}