mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-24 13:29:55 +00:00
reapply screen config on reattach
This commit is contained in:
parent
a26b38f5ae
commit
9bee253dd0
@ -51,6 +51,7 @@ export class TerminalTabComponent extends BaseTabComponent {
|
|||||||
this.session = this.sessions.addSession(
|
this.session = this.sessions.addSession(
|
||||||
Object.assign({}, this.sessionOptions, resizeEvent)
|
Object.assign({}, this.sessionOptions, resizeEvent)
|
||||||
)
|
)
|
||||||
|
this.session.resize(resizeEvent.width, resizeEvent.height)
|
||||||
// this.session.output$.bufferTime(10).subscribe((datas) => {
|
// this.session.output$.bufferTime(10).subscribe((datas) => {
|
||||||
this.session.output$.subscribe(data => {
|
this.session.output$.subscribe(data => {
|
||||||
// let data = datas.join('')
|
// let data = datas.join('')
|
||||||
|
@ -64,7 +64,7 @@ export class ScreenPersistenceProvider extends SessionPersistenceProvider {
|
|||||||
recoveryId,
|
recoveryId,
|
||||||
recoveredTruePID$: truePID$.asObservable(),
|
recoveredTruePID$: truePID$.asObservable(),
|
||||||
command: 'screen',
|
command: 'screen',
|
||||||
args: ['-d', '-r', recoveryId],
|
args: ['-d', '-r', recoveryId, '-c', await this.prepareConfig()],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,26 +85,8 @@ export class ScreenPersistenceProvider extends SessionPersistenceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async startSession (options: SessionOptions): Promise<any> {
|
async startSession (options: SessionOptions): Promise<any> {
|
||||||
let configPath = '/tmp/.termScreenConfig'
|
|
||||||
await fs.writeFile(configPath, `
|
|
||||||
escape ^^^
|
|
||||||
vbell off
|
|
||||||
deflogin on
|
|
||||||
defflow off
|
|
||||||
term xterm-color
|
|
||||||
bindkey "^[OH" beginning-of-line
|
|
||||||
bindkey "^[OF" end-of-line
|
|
||||||
bindkey "\\027[?1049h" stuff ----alternate enter-----
|
|
||||||
bindkey "\\027[?1049l" stuff ----alternate leave-----
|
|
||||||
termcapinfo xterm* 'hs:ts=\\E]0;:fs=\\007:ds=\\E]0;\\007'
|
|
||||||
defhstatus "^Et"
|
|
||||||
hardstatus off
|
|
||||||
altscreen on
|
|
||||||
defutf8 on
|
|
||||||
defencoding utf8
|
|
||||||
`, 'utf-8')
|
|
||||||
let recoveryId = `term-tab-${Date.now()}`
|
let recoveryId = `term-tab-${Date.now()}`
|
||||||
let args = ['-d', '-m', '-c', configPath, '-U', '-S', recoveryId, '-T', 'xterm-256color', '--', '-' + options.command].concat(options.args || [])
|
let args = ['-d', '-m', '-c', await this.prepareConfig(), '-U', '-S', recoveryId, '-T', 'xterm-256color', '--', '-' + options.command].concat(options.args || [])
|
||||||
this.logger.debug('Spawning screen with', args.join(' '))
|
this.logger.debug('Spawning screen with', args.join(' '))
|
||||||
await spawn('screen', args, {
|
await spawn('screen', args, {
|
||||||
cwd: options.cwd,
|
cwd: options.cwd,
|
||||||
@ -120,4 +102,28 @@ export class ScreenPersistenceProvider extends SessionPersistenceProvider {
|
|||||||
// screen has already quit
|
// screen has already quit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async prepareConfig (): Promise<string> {
|
||||||
|
let configPath = '/tmp/.termScreenConfig'
|
||||||
|
await fs.writeFile(configPath, `
|
||||||
|
escape ^^^
|
||||||
|
vbell off
|
||||||
|
deflogin on
|
||||||
|
defflow off
|
||||||
|
term xterm-color
|
||||||
|
bindkey "^[OH" beginning-of-line
|
||||||
|
bindkey "^[OF" end-of-line
|
||||||
|
bindkey "^[[H" beginning-of-line
|
||||||
|
bindkey "^[[F" end-of-line
|
||||||
|
bindkey "\\027[?1049h" stuff ----alternate enter-----
|
||||||
|
bindkey "\\027[?1049l" stuff ----alternate leave-----
|
||||||
|
termcapinfo xterm* 'hs:ts=\\E]0;:fs=\\007:ds=\\E]0;\\007'
|
||||||
|
defhstatus "^Et"
|
||||||
|
hardstatus off
|
||||||
|
altscreen on
|
||||||
|
defutf8 on
|
||||||
|
defencoding utf8
|
||||||
|
`, 'utf-8')
|
||||||
|
return configPath
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user