diff --git a/tabby-settings/src/components/editProfileModal.component.ts b/tabby-settings/src/components/editProfileModal.component.ts index e8b2977e..15b4bd4c 100644 --- a/tabby-settings/src/components/editProfileModal.component.ts +++ b/tabby-settings/src/components/editProfileModal.component.ts @@ -16,7 +16,7 @@ const iconsClassList = Object.keys(iconsData).map( templateUrl: './editProfileModal.component.pug', }) export class EditProfileModalComponent
> { - @Input('profile') _profile: P + @Input('profile') partialProfile: P @Input() profileProvider: PP @Input() settingsComponent: new () => ProfileSettingsComponent
@Input() defaultsMode: 'enabled'|'group'|'disabled' = 'disabled' @@ -56,7 +56,7 @@ export class EditProfileModalComponent
(this._profile, { skipGlobalDefaults: this.defaultsMode === 'enabled', skipGroupDefaults: this.defaultsMode === 'group' }) + this.profile = this.profilesService.getConfigProxyForProfile
(this.partialProfile, { skipGlobalDefaults: this.defaultsMode === 'enabled', skipGroupDefaults: this.defaultsMode === 'group' }) } ngAfterViewInit () { @@ -96,7 +96,7 @@ export class EditProfileModalComponent
null) @@ -193,7 +193,7 @@ export class ProfilesSettingsTabComponent extends BaseComponent { ) const model = group.defaults?.[provider.id] ?? {} model.type = provider.id - modal.componentInstance.profile = Object.assign({}, model) + modal.componentInstance.partialProfile = Object.assign({}, model) modal.componentInstance.profileProvider = provider modal.componentInstance.defaultsMode = 'group' @@ -300,7 +300,7 @@ export class ProfilesSettingsTabComponent extends BaseComponent { ) const model = this.profilesService.getProviderDefaults(provider) model.type = provider.id - modal.componentInstance.profile = Object.assign({}, model) + modal.componentInstance.partialProfile = Object.assign({}, model) modal.componentInstance.profileProvider = provider modal.componentInstance.defaultsMode = 'enabled' const result = await modal.result.catch(() => null) diff --git a/tabby-terminal/package.json b/tabby-terminal/package.json index cfd11709..f0a83411 100644 --- a/tabby-terminal/package.json +++ b/tabby-terminal/package.json @@ -19,16 +19,15 @@ "author": "Tabby Developers", "license": "MIT", "devDependencies": { - "@xterm/addon-canvas": "^0.7.0", - "@xterm/addon-clipboard": "^0.2.0", - "@xterm/addon-fit": "^0.11.0", - "@xterm/addon-image": "^0.9.0", - "@xterm/addon-ligatures": "^0.10.0", - "@xterm/addon-search": "^0.16.0", - "@xterm/addon-serialize": "^0.14.0", - "@xterm/addon-unicode11": "^0.9.0", - "@xterm/addon-webgl": "^0.19.0", - "@xterm/xterm": "^6.0.0", + "@xterm/addon-canvas": "^0.6.0", + "@xterm/addon-fit": "^0.9.0", + "@xterm/addon-image": "^0.7.0", + "@xterm/addon-ligatures": "^0.8.0", + "@xterm/addon-search": "^0.14.0", + "@xterm/addon-serialize": "^0.12.0", + "@xterm/addon-unicode11": "^0.7.0", + "@xterm/addon-webgl": "^0.17.0", + "@xterm/xterm": "^5.4.0", "ansi-colors": "^4.1.1", "binstring": "^0.2.1", "buffer-replace": "^1.0.0", diff --git a/tabby-terminal/src/api/baseTerminalTab.component.ts b/tabby-terminal/src/api/baseTerminalTab.component.ts index bd814e57..b91623ef 100644 --- a/tabby-terminal/src/api/baseTerminalTab.component.ts +++ b/tabby-terminal/src/api/baseTerminalTab.component.ts @@ -447,7 +447,10 @@ export class BaseTerminalTabComponent
extends Bas .subscribe(visibility => { if (this.frontend instanceof XTermFrontend) { if (visibility) { - this.frontend.xterm.refresh(0, this.frontend.xterm.rows - 1) + // this.frontend.resizeHandler() + const term = this.frontend.xterm as any + term._core._renderService?.clear() + term._core._renderService?.handleResize(term.cols, term.rows) } else { this.frontend.xterm.element?.querySelectorAll('canvas').forEach(c => { c.height = c.width = 0 @@ -823,6 +826,11 @@ export class BaseTerminalTabComponent
extends Bas
this.attachSessionHandler(this.session.destroyed$, () => {
this.onSessionDestroyed()
})
+
+ this.attachSessionHandler(this.session.oscProcessor.copyRequested$, content => {
+ this.platform.setClipboard({ text: content })
+ this.notifications.notice(this.translate.instant('Copied'))
+ })
}
/**
diff --git a/tabby-terminal/src/frontends/xterm.css b/tabby-terminal/src/frontends/xterm.css
index 761efd1b..6f3696b2 100644
--- a/tabby-terminal/src/frontends/xterm.css
+++ b/tabby-terminal/src/frontends/xterm.css
@@ -5,11 +5,15 @@
src: url(../fonts/SourceCodePro.ttf) format("truetype");
}
+.xterm-viewport::-webkit-scrollbar {
+ background: rgba(0, 0, 0, .125);
+}
+
+.xterm-viewport::-webkit-scrollbar-thumb {
+ background: rgba(255, 255, 255, .25);
+}
+
.xterm-decoration-overview-ruler {
right: 1px;
pointer-events: none;
}
-
-.xterm-viewport {
- background: none !important;
-}
diff --git a/tabby-terminal/src/frontends/xtermFrontend.ts b/tabby-terminal/src/frontends/xtermFrontend.ts
index 15073382..56345534 100644
--- a/tabby-terminal/src/frontends/xtermFrontend.ts
+++ b/tabby-terminal/src/frontends/xtermFrontend.ts
@@ -1,11 +1,10 @@
import deepEqual from 'deep-equal'
import { BehaviorSubject, filter, firstValueFrom, takeUntil } from 'rxjs'
import { Injector } from '@angular/core'
-import { ConfigService, getCSSFontFamily, getWindows10Build, HostAppService, HotkeysService, NotificationsService, Platform, PlatformService, ThemesService, TranslateService } from 'tabby-core'
+import { ConfigService, getCSSFontFamily, getWindows10Build, HostAppService, HotkeysService, Platform, PlatformService, ThemesService } from 'tabby-core'
import { Frontend, SearchOptions, SearchState } from './frontend'
import { Terminal, ITheme } from '@xterm/xterm'
import { FitAddon } from '@xterm/addon-fit'
-import { ClipboardAddon } from '@xterm/addon-clipboard'
import { LigaturesAddon } from '@xterm/addon-ligatures'
import { ISearchOptions, SearchAddon } from '@xterm/addon-search'
import { WebglAddon } from '@xterm/addon-webgl'
@@ -89,8 +88,6 @@ export class XTermFrontend extends Frontend {
private platformService: PlatformService
private hostApp: HostAppService
private themes: ThemesService
- private notifications: NotificationsService
- private translate: TranslateService
constructor (injector: Injector) {
super(injector)
@@ -99,18 +96,11 @@ export class XTermFrontend extends Frontend {
this.platformService = injector.get(PlatformService)
this.hostApp = injector.get(HostAppService)
this.themes = injector.get(ThemesService)
- this.notifications = injector.get(NotificationsService)
- this.translate = injector.get(TranslateService)
this.xterm = new Terminal({
allowTransparency: true,
allowProposedApi: true,
- overviewRuler: {
- width: 8,
- showBottomBorder: false,
- showTopBorder: false,
- },
- reflowCursorLine: true,
+ overviewRulerWidth: 8,
windowsPty: process.platform === 'win32' ? {
backend: this.configService.store.terminal.useConPTY ? 'conpty' : 'winpty',
buildNumber: getWindows10Build(),
@@ -146,15 +136,6 @@ export class XTermFrontend extends Frontend {
this.xterm.loadAddon(this.fitAddon)
this.xterm.loadAddon(this.serializeAddon)
this.xterm.loadAddon(new Unicode11Addon())
- this.xterm.loadAddon(new ClipboardAddon(undefined, {
- readText: async () => {
- return this.platformService.readClipboard()
- },
- writeText: async (_, text) => {
- this.platformService.setClipboard({ text })
- this.notifications.notice(this.translate.instant('Copied'))
- },
- }))
this.xterm.unicode.activeVersion = '11'
if (this.configService.store.terminal.sixel) {
@@ -231,7 +212,7 @@ export class XTermFrontend extends Frontend {
const savedViewportY = this.xterm.buffer.active.viewportY
this.fitAddon.fit()
- this.xterm.refresh(0, this.xterm.rows - 1)
+ this.xtermCore.viewport._refresh()
if (savedPinned) {
this.xtermCore._scrollToBottom()
@@ -260,7 +241,6 @@ export class XTermFrontend extends Frontend {
const altBufferActive = this.xterm.buffer.active.type === 'alternate'
this.alternateScreenActive.next(altBufferActive)
})
-
}
private isAtBottom (): boolean {
@@ -485,17 +465,12 @@ export class XTermFrontend extends Frontend {
background: getTerminalBackgroundColor(this.configService, this.themes, scheme) ?? '#00000000',
cursor: scheme.cursor,
cursorAccent: scheme.cursorAccent,
- overviewRulerBorder: scheme.background,
}
for (let i = 0; i < COLOR_NAMES.length; i++) {
theme[COLOR_NAMES[i]] = scheme.colors[i]
}
- theme.scrollbarSliderBackground = theme.brightBlack
- theme.scrollbarSliderHoverBackground = theme.brightBlack
- theme.scrollbarSliderHoverBackground = theme.brightBlack
-
if (!deepEqual(this.configuredTheme, theme)) {
this.xterm.options.theme = theme
this.configuredTheme = theme
@@ -517,12 +492,9 @@ export class XTermFrontend extends Frontend {
}
})
- this.xtermCore.browser = {
- ...this.xtermCore.browser,
- isWindows: this.hostApp.platform === Platform.Windows,
- isLinux: this.hostApp.platform === Platform.Linux,
- isMac: this.hostApp.platform === Platform.macOS,
- }
+ this.xtermCore.browser.isWindows = this.hostApp.platform === Platform.Windows
+ this.xtermCore.browser.isLinux = this.hostApp.platform === Platform.Linux
+ this.xtermCore.browser.isMac = this.hostApp.platform === Platform.macOS
this.xterm.options.fontFamily = getCSSFontFamily(config)
this.xterm.options.cursorStyle = {
diff --git a/tabby-terminal/src/middleware/oscProcessing.ts b/tabby-terminal/src/middleware/oscProcessing.ts
index d67a4cd6..adbc6b13 100644
--- a/tabby-terminal/src/middleware/oscProcessing.ts
+++ b/tabby-terminal/src/middleware/oscProcessing.ts
@@ -7,9 +7,11 @@ const OSCSuffixes = [Buffer.from('\x07'), Buffer.from('\x1b\\')]
export class OSCProcessor extends SessionMiddleware {
get cwdReported$ (): Observable