contour-terminal / contour

Modern C++ Terminal Emulator
http://contour-terminal.org/
Apache License 2.0
2.3k stars 100 forks source link

Pasted text evaluated via shell #1549

Open Yaraslaut opened 5 days ago

Yaraslaut commented 5 days ago

Abstract

When pasting text sometimes you want it to be evaluated via shell immediately, for example you cat readme file and want to run something that you select there. To do this now you need to paste selection and then press enter

Specification

Add argument for PasteSelection action, named execute so you can configure whether to run selected command then key mapping entry can look like

    - { mods: [], mouse: Middle,  action: PasteSelection, mode: 'Insert', execute: 'true' }
christianparpart commented 1 day ago

At first I wanted to propose to extend SendChars action isntead, by allowing it to also send the clipboard (in a variable substitution format like syntax) plus a final linefeed like \n). But I think SendChars should not issue bracketed paste (as it's not doing right now, but should then, if clipboard is involved).

Maybe the solution would. be to rename your suggestion a bit. execute sounds misleading. All it would do is to append a linefeed. 🤔 (thinking out loud here)