mirror of
https://github.com/eugeny/tabby
synced 2026-09-27 15:35:52 +00:00
Flash taskbar/dock icon when the terminal bell rings (#11651)
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Eugene <x@null.page>
This commit is contained in:
co-authored by
Cursor Agent
Eugene
parent
8ad4a4fad9
commit
ea8013003b
@@ -374,6 +374,7 @@ export class Window {
|
||||
})
|
||||
|
||||
this.window.on('focus', () => {
|
||||
this.window.flashFrame(false)
|
||||
this.send('host:window-focused')
|
||||
})
|
||||
|
||||
@@ -478,6 +479,12 @@ export class Window {
|
||||
this.on('window-set-progress-bar', (_, value) => {
|
||||
this.window?.setProgressBar(value, { mode: value < 0 ? 'none' : 'normal' })
|
||||
})
|
||||
|
||||
this.on('window-flash-frame', () => {
|
||||
if (this.window && !this.window.isFocused()) {
|
||||
this.window.flashFrame(true)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
on (event: string, listener: (...args: any[]) => void): void {
|
||||
|
||||
@@ -33,4 +33,7 @@ export abstract class HostWindowService {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
bringToFront (): void { }
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
flashFrame (): void { }
|
||||
}
|
||||
|
||||
@@ -127,4 +127,8 @@ export class ElectronHostWindow extends HostWindowService {
|
||||
bringToFront (): void {
|
||||
this.electron.ipcRenderer.send('window-bring-to-front')
|
||||
}
|
||||
|
||||
flashFrame (): void {
|
||||
this.electron.ipcRenderer.send('window-flash-frame')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -434,6 +434,9 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
|
||||
if (this.config.store.terminal.bell === 'audible') {
|
||||
this.bellPlayer.play()
|
||||
}
|
||||
if (this.config.store.terminal.bellFlashFrame) {
|
||||
this.hostWindow.flashFrame()
|
||||
}
|
||||
if (!this.hasFocus) {
|
||||
this.displayActivity()
|
||||
}
|
||||
|
||||
@@ -209,6 +209,15 @@ div.mt-4
|
||||
label.btn.btn-secondary(for='bellAudible')
|
||||
span(translate) Audible
|
||||
|
||||
.form-line(*ngIf='hostApp.platform !== Platform.Web')
|
||||
.header
|
||||
.title(translate) Flash taskbar
|
||||
.description(translate) Flash the taskbar or dock icon when the terminal bell rings and the window is not focused
|
||||
toggle(
|
||||
[(ngModel)]='config.store.terminal.bellFlashFrame',
|
||||
(ngModelChange)='config.save()',
|
||||
)
|
||||
|
||||
.alert.alert-info.d-flex.align-items-center(*ngIf='config.store.terminal.bell != "audible" && (config.store.terminal.profile || "").startsWith("wsl")')
|
||||
.me-auto(translate) WSL terminal bell can only be muted via Volume Mixer
|
||||
button.btn.btn-secondary((click)='openWSLVolumeMixer()', translate) Show Mixer
|
||||
|
||||
@@ -23,6 +23,7 @@ export class TerminalConfigProvider extends ConfigProvider {
|
||||
fallbackFont: null,
|
||||
linePadding: 0,
|
||||
bell: 'off',
|
||||
bellFlashFrame: false,
|
||||
bracketedPaste: true,
|
||||
background: 'theme',
|
||||
ligatures: false,
|
||||
|
||||
Reference in New Issue
Block a user