mirror of
https://github.com/Eugeny/tabby.git
synced 2024-12-25 19:42:42 +03:00
fixed profile launching
This commit is contained in:
parent
48ff7d7d5a
commit
26d7dc3031
@ -63,15 +63,18 @@ export class TerminalService {
|
||||
* @param pause Wait for a keypress when the shell exits
|
||||
*/
|
||||
async openTab (profile?: Profile, cwd?: string, pause?: boolean): Promise<TerminalTabComponent> {
|
||||
cwd = cwd || profile.sessionOptions.cwd
|
||||
if (cwd && !fs.existsSync(cwd)) {
|
||||
console.warn('Ignoring non-existent CWD:', cwd)
|
||||
cwd = null
|
||||
}
|
||||
if (!profile) {
|
||||
let profiles = await this.getProfiles()
|
||||
profile = profiles.find(x => slug(x.name) === this.config.store.terminal.profile) || profiles[0]
|
||||
}
|
||||
|
||||
cwd = cwd || profile.sessionOptions.cwd
|
||||
|
||||
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…
Reference in New Issue
Block a user