mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-31 14:36:57 +00:00
disable progress detection when alt buffer is active
This commit is contained in:
@@ -68,6 +68,8 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
||||
*/
|
||||
enableDynamicTitle = true
|
||||
|
||||
alternateScreenActive = false
|
||||
|
||||
// Deps start
|
||||
config: ConfigService
|
||||
element: ElementRef
|
||||
@@ -210,6 +212,10 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
||||
this.session.releaseInitialDataBuffer()
|
||||
})
|
||||
|
||||
this.alternateScreenActive$.subscribe(x => {
|
||||
this.alternateScreenActive = x
|
||||
})
|
||||
|
||||
if (this.savedState) {
|
||||
this.frontend.restoreState(this.savedState)
|
||||
this.frontend.write('\r\n\r\n')
|
||||
@@ -279,7 +285,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
||||
*/
|
||||
write (data: string): void {
|
||||
const percentageMatch = /(^|[^\d])(\d+(\.\d+)?)%([^\d]|$)/.exec(data)
|
||||
if (percentageMatch) {
|
||||
if (!this.alternateScreenActive && percentageMatch) {
|
||||
const percentage = percentageMatch[3] ? parseFloat(percentageMatch[2]) : parseInt(percentageMatch[2])
|
||||
if (percentage > 0 && percentage <= 100) {
|
||||
this.setProgress(percentage)
|
||||
@@ -302,7 +308,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
||||
data = data.replace(/\n/g, '\r')
|
||||
}
|
||||
|
||||
if (data.includes('\r')) {
|
||||
if (!this.alternateScreenActive && data.includes('\r')) {
|
||||
const canTrim = !data.trim().includes('\r')
|
||||
const buttons = canTrim ? ['Paste', 'Trim whitespace and paste', 'Cancel'] : ['Paste', 'Cancel']
|
||||
const result = (await this.electron.showMessageBox(
|
||||
|
@@ -121,6 +121,11 @@ export class XTermFrontend extends Frontend {
|
||||
this.xtermCore.updateCursorStyle(e)
|
||||
keyboardEventHandler('keyup', e)
|
||||
}
|
||||
|
||||
this.xtermCore._bufferService.buffers.onBufferActivate(e => {
|
||||
const altBufferActive = e.activeBuffer === this.xtermCore._bufferService.buffers.alt
|
||||
this.alternateScreenActive.next(altBufferActive)
|
||||
})
|
||||
}
|
||||
|
||||
attach (host: HTMLElement): void {
|
||||
|
Reference in New Issue
Block a user