diff --git a/terminus-terminal/src/components/shellSettingsTab.component.pug b/terminus-terminal/src/components/shellSettingsTab.component.pug index ab526fab..b1ebc8b4 100644 --- a/terminus-terminal/src/components/shellSettingsTab.component.pug +++ b/terminus-terminal/src/components/shellSettingsTab.component.pug @@ -14,8 +14,19 @@ h3.mb-3 Shell [ngValue]='shell.id' ) {{shell.name}} -.alert.alert-info.d-flex.align-items-center(*ngIf='config.store.terminal.shell.startsWith("wsl") && config.store.terminal.frontend != "xterm"') - .mr-auto WSL terminal only supports TrueColor with the xterm frontend + +.form-line(*ngIf='hostApp.platform === Platform.Windows') + .header + .title Use ConPTY + .description Enables the experimental Windows ConPTY API + + toggle( + [(ngModel)]='config.store.terminal.useConPTY', + (ngModelChange)='config.save()' + ) + +.alert.alert-info.d-flex.align-items-center(*ngIf='config.store.terminal.shell.startsWith("wsl") && (config.store.terminal.frontend != "hterm" || !config.store.terminal.useConPTY)') + .mr-auto WSL terminal only supports TrueColor with ConPTY and the xterm frontend .form-line(*ngIf='config.store.terminal.shell == "custom"') .header diff --git a/terminus-terminal/src/components/shellSettingsTab.component.ts b/terminus-terminal/src/components/shellSettingsTab.component.ts index 234c0e52..f3c7a0cd 100644 --- a/terminus-terminal/src/components/shellSettingsTab.component.ts +++ b/terminus-terminal/src/components/shellSettingsTab.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' -import { ConfigService, ElectronService } from 'terminus-core' +import { ConfigService, ElectronService, HostAppService, Platform } from 'terminus-core' import { EditProfileModalComponent } from './editProfileModal.component' import { IShell, Profile } from '../api' import { TerminalService } from '../services/terminal.service' @@ -11,9 +11,11 @@ import { TerminalService } from '../services/terminal.service' export class ShellSettingsTabComponent { shells: IShell[] = [] profiles: Profile[] = [] + Platform = Platform constructor ( public config: ConfigService, + public hostApp: HostAppService, private electron: ElectronService, private terminalService: TerminalService, private ngbModal: NgbModal, diff --git a/terminus-terminal/src/config.ts b/terminus-terminal/src/config.ts index 3bbc1251..adb66049 100644 --- a/terminus-terminal/src/config.ts +++ b/terminus-terminal/src/config.ts @@ -52,6 +52,7 @@ export class TerminalConfigProvider extends ConfigProvider { customColorSchemes: [], environment: {}, profiles: [], + useConPTY: true, }, } diff --git a/terminus-terminal/src/services/sessions.service.ts b/terminus-terminal/src/services/sessions.service.ts index 4c522e89..0709f96a 100644 --- a/terminus-terminal/src/services/sessions.service.ts +++ b/terminus-terminal/src/services/sessions.service.ts @@ -108,6 +108,7 @@ export class Session extends BaseSession { rows: options.height || 30, cwd: options.cwd || process.env.HOME, env: env, + experimentalUseConpty: this.config.store.terminal.useConPTY, }) this.truePID = (this.pty as any).pid