mirror of
https://github.com/Eugeny/tabby.git
synced 2025-10-04 22:14:55 +00:00
bumped xterm, check bracketedPaste state via terminal modes
This commit is contained in:
@@ -127,7 +127,6 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
||||
private termContainerSubscriptions = new SubscriptionContainer()
|
||||
private allFocusModeSubscription: Subscription|null = null
|
||||
private sessionHandlers = new SubscriptionContainer()
|
||||
private sessionSupportsBracketedPaste = false
|
||||
private spinner = new Spinner({
|
||||
stream: {
|
||||
write: x => {
|
||||
@@ -418,19 +417,12 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
||||
}
|
||||
}
|
||||
|
||||
if (data.includes('\x1b[?2004h')) {
|
||||
this.sessionSupportsBracketedPaste = true
|
||||
}
|
||||
if (data.includes('\x1b[?2004l')) {
|
||||
this.sessionSupportsBracketedPaste = false
|
||||
}
|
||||
|
||||
this.frontend.write(data)
|
||||
}
|
||||
|
||||
async paste (): Promise<void> {
|
||||
let data = this.platform.readClipboard()
|
||||
if (this.config.store.terminal.bracketedPaste && this.sessionSupportsBracketedPaste) {
|
||||
if (this.config.store.terminal.bracketedPaste && this.frontend?.supportsBracketedPaste()) {
|
||||
data = `\x1b[200~${data}\x1b[201~`
|
||||
}
|
||||
if (this.hostApp.platform === Platform.Windows) {
|
||||
|
@@ -12,7 +12,7 @@ export class TerminalConfigProvider extends ConfigProvider {
|
||||
fallbackFont: null,
|
||||
linePadding: 0,
|
||||
bell: 'off',
|
||||
bracketedPaste: false,
|
||||
bracketedPaste: true,
|
||||
background: 'theme',
|
||||
ligatures: false,
|
||||
cursor: 'block',
|
||||
|
@@ -76,4 +76,6 @@ export abstract class Frontend {
|
||||
|
||||
abstract saveState (): any
|
||||
abstract restoreState (state: string): void
|
||||
|
||||
abstract supportsBracketedPaste (): boolean
|
||||
}
|
||||
|
@@ -324,6 +324,10 @@ export class XTermFrontend extends Frontend {
|
||||
this.xterm.write(state)
|
||||
}
|
||||
|
||||
supportsBracketedPaste (): boolean {
|
||||
return this.xterm.modes.bracketedPasteMode
|
||||
}
|
||||
|
||||
private setFontSize () {
|
||||
const scale = Math.pow(1.1, this.zoom)
|
||||
this.xterm.setOption('fontSize', this.configuredFontSize * scale)
|
||||
|
Reference in New Issue
Block a user