mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-24 09:06:03 +00:00
fixed #597
This commit is contained in:
@@ -264,7 +264,7 @@ export class Session extends BaseSession {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
fs.access(this.guessedCWD)
|
await fs.access(this.guessedCWD)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import * as fs from 'mz/fs'
|
||||||
import { Observable, AsyncSubject } from 'rxjs'
|
import { Observable, AsyncSubject } from 'rxjs'
|
||||||
import { Injectable, Inject } from '@angular/core'
|
import { Injectable, Inject } from '@angular/core'
|
||||||
import { AppService, Logger, LogService, ConfigService } from 'terminus-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> {
|
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 (!cwd) {
|
||||||
if (this.app.activeTab instanceof TerminalTabComponent && this.app.activeTab.session) {
|
if (this.app.activeTab instanceof TerminalTabComponent && this.app.activeTab.session) {
|
||||||
cwd = await this.app.activeTab.session.getWorkingDirectory()
|
cwd = await this.app.activeTab.session.getWorkingDirectory()
|
||||||
|
Reference in New Issue
Block a user