Skip to content

Commit

Permalink
feat(core/settings/serial/ssh/telnet): add clearServiceMessagesOnConn…
Browse files Browse the repository at this point in the history
…ect option on connectable profile
  • Loading branch information
Clem-Fern committed Aug 14, 2023
1 parent 21e38c8 commit ef6b8a4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions tabby-core/src/api/profileProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface Profile {
}

export interface ConnectableProfile extends Profile {
clearServiceMessagesOnConnect: boolean
}

export type PartialProfile<T extends Profile> = Omit<Omit<Omit<{
Expand Down
1 change: 1 addition & 0 deletions tabby-serial/src/profiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class SerialProfilesService extends ConnectableProfileProvider<SerialProf
slowSend: false,
input: { backspace: 'backspace' },
},
clearServiceMessagesOnConnect: false,
}

constructor (
Expand Down
8 changes: 7 additions & 1 deletion tabby-settings/src/components/editProfileModal.component.pug
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@
option(ngValue='keep', translate) Keep
option(*ngIf='isConnectable()', ngValue='reconnect', translate) Reconnect
option(ngValue='close', translate) Close


.form-line(*ngIf='isConnectable()')
.header
.title(translate) Clear terminal after connection
toggle(
[(ngModel)]='profile.clearServiceMessagesOnConnect',
)
.mb-4

.col-12.col-lg-8(*ngIf='this.profileProvider.settingsComponent')
Expand Down
1 change: 1 addition & 0 deletions tabby-ssh/src/profiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export class SSHProfilesService extends ConnectableProfileProvider<SSHProfile> {
reuseSession: true,
input: { backspace: 'backspace' },
},
clearServiceMessagesOnConnect: true,
}

constructor (
Expand Down
1 change: 1 addition & 0 deletions tabby-telnet/src/profiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class TelnetProfilesService extends ConnectableProfileProvider<TelnetProf
scripts: [],
input: { backspace: 'backspace' },
},
clearServiceMessagesOnConnect: false,
}

constructor (private translate: TranslateService) { super() }
Expand Down
3 changes: 3 additions & 0 deletions tabby-terminal/src/api/connectableTerminalTab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export abstract class ConnectableTerminalTabComponent<P extends ConnectableTermi
async initializeSession (): Promise<void> {
this.reconnectOffered = false
this.isDisconnectedByHand = false
if (this.profile.clearServiceMessagesOnConnect) {
this.frontend?.clear()
}
}

/**
Expand Down

0 comments on commit ef6b8a4

Please sign in to comment.