mirror of
https://github.com/Eugeny/tabby
synced 2024-11-15 17:28:06 +00:00
xterm copy-on-select (fixes #400)
This commit is contained in:
parent
f32bdbdeac
commit
60358e7ac4
1 changed files with 8 additions and 0 deletions
|
@ -16,6 +16,7 @@ export class XTermFrontend extends Frontend {
|
||||||
private zoom = 0
|
private zoom = 0
|
||||||
private resizeHandler: any
|
private resizeHandler: any
|
||||||
private configuredTheme: ITheme = {}
|
private configuredTheme: ITheme = {}
|
||||||
|
private copyOnSelect = false
|
||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
super()
|
super()
|
||||||
|
@ -33,6 +34,11 @@ export class XTermFrontend extends Frontend {
|
||||||
this.xterm.on('title', title => {
|
this.xterm.on('title', title => {
|
||||||
this.title.next(title)
|
this.title.next(title)
|
||||||
})
|
})
|
||||||
|
this.xterm.on('selection', () => {
|
||||||
|
if (this.copyOnSelect) {
|
||||||
|
this.copySelection()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
attach (host: HTMLElement): void {
|
attach (host: HTMLElement): void {
|
||||||
|
@ -101,6 +107,8 @@ export class XTermFrontend extends Frontend {
|
||||||
this.configuredFontSize = config.terminal.fontSize
|
this.configuredFontSize = config.terminal.fontSize
|
||||||
this.setFontSize()
|
this.setFontSize()
|
||||||
|
|
||||||
|
this.copyOnSelect = config.terminal.copyOnSelect
|
||||||
|
|
||||||
let theme: ITheme = {
|
let theme: ITheme = {
|
||||||
foreground: config.terminal.colorScheme.foreground,
|
foreground: config.terminal.colorScheme.foreground,
|
||||||
background: (config.terminal.background === 'colorScheme') ? config.terminal.colorScheme.background : 'transparent',
|
background: (config.terminal.background === 'colorScheme') ? config.terminal.colorScheme.background : 'transparent',
|
||||||
|
|
Loading…
Reference in a new issue