1

I was wondering if it's possible to automatically paste copied text from browser (Firefox) into terminal? (Linux)

When working with something like a tutorial in Github the auto command text copy function is great but would be even more efficient if it automatically pastes into the terminal and runs the command.

1
  • 2
    Are you asking as a web developer, or as a user? (If the former, you're asking for something incredibly dangerous. If the latter, IMHO trying to be "more efficient" kinda misses the whole point of a tutorial.) Commented Oct 7, 2021 at 9:43

1 Answer 1

1

Unlikely.

Firstly what you copy from a tutorial is just text. To automatically run it on paste the text needs to contain a carriage return. It doesn't, so the utility needs to add it. If it's done automatically, it will affect every piece of text you copy, not only shell commands - how'd it tell the difference?

Secondly you'd need to link the browser process and the shell process together in a way that events in one directly affect the other. Check ps -ef when your Firefox is running - how to identify the appropriate process to link? How about if you have multiple shell instances running - how would the appropriate process be identified?

Most important are however the severe security implications user1686 brought up in his comment.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .