hluk / CopyQ

Clipboard manager with advanced features
GNU General Public License v3.0
8.26k stars 430 forks source link

Auto remove trailing line return #2573

Closed joihn closed 7 months ago

joihn commented 7 months ago

Sometimes I copy commands and I accidentally include a line return. I want to paste them to my termnial, edit them a bit, then execute them. However since a trailing line return (i.e, newline at the end, i.e \n ) is present, the command is directly executed

Describe the solution you'd like A option to automatically remove any trailing line return when copied

joihn commented 7 months ago

solved with a custom command :)

copyq:
var text = str(clipboard())
text = text.replace(/\n+$/, '')
copy(text)

make sure to set input as automatic