Merge pull request #8726 from Clem-Fern/profiles-rework

This commit is contained in:
Eugene
2023-08-25 23:36:46 +02:00
committed by GitHub
39 changed files with 786 additions and 274 deletions

View File

@@ -4,7 +4,7 @@ import { Injector, Component } from '@angular/core'
import { first } from 'rxjs'
import { BaseTerminalProfile } from './interfaces'
import { ConnectableTerminalProfile } from './interfaces'
import { BaseTerminalTabComponent } from './baseTerminalTab.component'
import { GetRecoveryTokenOptions, RecoveryToken } from 'tabby-core'
@@ -13,7 +13,7 @@ import { GetRecoveryTokenOptions, RecoveryToken } from 'tabby-core'
* A class to base your custom connectable terminal tabs on
*/
@Component({ template: '' })
export abstract class ConnectableTerminalTabComponent<P extends BaseTerminalProfile> extends BaseTerminalTabComponent<P> {
export abstract class ConnectableTerminalTabComponent<P extends ConnectableTerminalProfile> extends BaseTerminalTabComponent<P> {
protected reconnectOffered = false
protected isDisconnectedByHand = false
@@ -57,6 +57,9 @@ export abstract class ConnectableTerminalTabComponent<P extends BaseTerminalProf
async initializeSession (): Promise<void> {
this.reconnectOffered = false
this.isDisconnectedByHand = false
if (this.profile.clearServiceMessagesOnConnect) {
this.frontend?.clear()
}
}
/**

View File

@@ -1,4 +1,4 @@
import { Profile } from 'tabby-core'
import { ConnectableProfile, Profile } from 'tabby-core'
export interface ResizeEvent {
columns: number
@@ -19,3 +19,5 @@ export interface TerminalColorScheme {
export interface BaseTerminalProfile extends Profile {
terminalColorScheme?: TerminalColorScheme
}
export interface ConnectableTerminalProfile extends BaseTerminalProfile, ConnectableProfile {}

View File

@@ -175,7 +175,7 @@ export class SaveAsProfileContextMenu extends TabContextMenuItemProvider {
const modal = this.ngbModal.open(PromptModalComponent)
modal.componentInstance.prompt = this.translate.instant('New profile name')
modal.componentInstance.value = tab.profile.name
const name = (await modal.result)?.value
const name = (await modal.result.catch(() => null))?.value
if (!name) {
return
}