Browse Source

made warnOnMultilinePaste optional (fixes #2309)

Eugene Pankov 5 years ago
parent
commit
09d55979ce

+ 1 - 1
terminus-terminal/src/api/baseTerminalTab.component.ts

@@ -308,7 +308,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
             data = data.replace(/\n/g, '\r')
         }
 
-        if (!this.alternateScreenActive && data.includes('\r')) {
+        if (!this.alternateScreenActive && data.includes('\r') && this.config.store.terminal.warnOnMultilinePaste) {
             const canTrim = !data.trim().includes('\r')
             const buttons = canTrim ? ['Paste', 'Trim whitespace and paste', 'Cancel'] : ['Paste', 'Cancel']
             const result = (await this.electron.showMessageBox(

+ 9 - 0
terminus-terminal/src/components/terminalSettingsTab.component.pug

@@ -136,3 +136,12 @@ h3.mb-3 Terminal
         [(ngModel)]='config.store.terminal.wordSeparator',
         (ngModelChange)='config.save()',
     )
+
+.form-line
+    .header
+        .title Warn on multi-line paste
+        .description Show a confirmation box when pasting multiple lines
+    toggle(
+        [(ngModel)]='config.store.terminal.warnOnMultilinePaste',
+        (ngModelChange)='config.save()',
+    )

+ 1 - 0
terminus-terminal/src/config.ts

@@ -63,6 +63,7 @@ export class TerminalConfigProvider extends ConfigProvider {
             profiles: [],
             useConPTY: true,
             recoverTabs: true,
+            warnOnMultilinePaste: true,
         },
     }