mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-08 13:30:02 +00:00
autoselect tmux
This commit is contained in:
parent
23dabca2ab
commit
c0c2b693f3
@ -48,7 +48,12 @@ import { hterm } from './hterm'
|
|||||||
if (hostApp.platform === Platform.Windows) {
|
if (hostApp.platform === Platform.Windows) {
|
||||||
return null
|
return null
|
||||||
} else {
|
} else {
|
||||||
return tmux
|
if (tmux.isAvailable()) {
|
||||||
|
tmux.init()
|
||||||
|
return tmux
|
||||||
|
} else {
|
||||||
|
return screen
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deps: [HostAppService, ScreenPersistenceProvider, TMuxPersistenceProvider],
|
deps: [HostAppService, ScreenPersistenceProvider, TMuxPersistenceProvider],
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
|
import { execFileSync } from 'child_process'
|
||||||
import * as AsyncLock from 'async-lock'
|
import * as AsyncLock from 'async-lock'
|
||||||
import { ConnectableObservable, Subject } from 'rxjs'
|
import { ConnectableObservable, Subject } from 'rxjs'
|
||||||
import * as childProcess from 'child_process'
|
import * as childProcess from 'child_process'
|
||||||
@ -166,6 +167,18 @@ export class TMuxPersistenceProvider extends SessionPersistenceProvider {
|
|||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
super()
|
super()
|
||||||
|
}
|
||||||
|
|
||||||
|
isAvailable (): boolean {
|
||||||
|
try {
|
||||||
|
execFileSync('tmux', ['-V'])
|
||||||
|
return true
|
||||||
|
} catch (_) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
init () {
|
||||||
this.tmux = new TMux()
|
this.tmux = new TMux()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user