diff --git a/terminus-terminal/src/api/baseTerminalTab.component.ts b/terminus-terminal/src/api/baseTerminalTab.component.ts index 83057029..126d85a1 100644 --- a/terminus-terminal/src/api/baseTerminalTab.component.ts +++ b/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( diff --git a/terminus-terminal/src/components/terminalSettingsTab.component.pug b/terminus-terminal/src/components/terminalSettingsTab.component.pug index 2a22060c..f71b07b5 100644 --- a/terminus-terminal/src/components/terminalSettingsTab.component.pug +++ b/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()', + ) diff --git a/terminus-terminal/src/config.ts b/terminus-terminal/src/config.ts index e8f6df1b..eda11c5e 100644 --- a/terminus-terminal/src/config.ts +++ b/terminus-terminal/src/config.ts @@ -63,6 +63,7 @@ export class TerminalConfigProvider extends ConfigProvider { profiles: [], useConPTY: true, recoverTabs: true, + warnOnMultilinePaste: true, }, }