فهرست منبع

feat(core/settings/serial/ssh/telnet): add clearServiceMessagesOnConnect option on connectable profile

Clem 2 سال پیش
والد
کامیت
ef6b8a4eaa

+ 1 - 0
tabby-core/src/api/profileProvider.ts

@@ -22,6 +22,7 @@ export interface Profile {
 }
 
 export interface ConnectableProfile extends Profile {
+    clearServiceMessagesOnConnect: boolean
 }
 
 export type PartialProfile<T extends Profile> = Omit<Omit<Omit<{

+ 1 - 0
tabby-serial/src/profiles.ts

@@ -32,6 +32,7 @@ export class SerialProfilesService extends ConnectableProfileProvider<SerialProf
             slowSend: false,
             input: { backspace: 'backspace' },
         },
+        clearServiceMessagesOnConnect: false,
     }
 
     constructor (

+ 7 - 1
tabby-settings/src/components/editProfileModal.component.pug

@@ -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')

+ 1 - 0
tabby-ssh/src/profiles.ts

@@ -44,6 +44,7 @@ export class SSHProfilesService extends ConnectableProfileProvider<SSHProfile> {
             reuseSession: true,
             input: { backspace: 'backspace' },
         },
+        clearServiceMessagesOnConnect: true,
     }
 
     constructor (

+ 1 - 0
tabby-telnet/src/profiles.ts

@@ -21,6 +21,7 @@ export class TelnetProfilesService extends ConnectableProfileProvider<TelnetProf
             scripts: [],
             input: { backspace: 'backspace' },
         },
+        clearServiceMessagesOnConnect: false,
     }
 
     constructor (private translate: TranslateService) { super() }

+ 3 - 0
tabby-terminal/src/api/connectableTerminalTab.component.ts

@@ -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()
+        }
     }
 
     /**