mirror of
https://github.com/Eugeny/tabby.git
synced 2025-04-12 16:10:26 +08:00
fixed #597
This commit is contained in:
parent
9faa346699
commit
3aaf490f57
@ -264,7 +264,7 @@ export class Session extends BaseSession {
|
||||
return null
|
||||
}
|
||||
try {
|
||||
fs.access(this.guessedCWD)
|
||||
await fs.access(this.guessedCWD)
|
||||
} catch (e) {
|
||||
return null
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
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'
|
||||
@ -41,6 +42,10 @@ export class TerminalService {
|
||||
}
|
||||
|
||||
async openTab (shell?: IShell, cwd?: string, pause?: boolean): Promise<TerminalTabComponent> {
|
||||
if (cwd && !fs.existsSync(cwd)) {
|
||||
console.warn('Ignoring non-existent CWD:', cwd)
|
||||
cwd = null
|
||||
}
|
||||
if (!cwd) {
|
||||
if (this.app.activeTab instanceof TerminalTabComponent && this.app.activeTab.session) {
|
||||
cwd = await this.app.activeTab.session.getWorkingDirectory()
|
||||
|
Loading…
x
Reference in New Issue
Block a user