Sample Header Ad - 728x90

How can I navigate and copy some text from the past terminal output?

2 votes
3 answers
1222 views
### Problem Very often when I work with git I need to copy some content from the output of the last command. And I hate switching from keyboard to trackpad/mouse. **Case #1**
...
➜  extract_ttc git:(feature/simplify-gha-workflows) git push
fatal: The current branch feature/simplify-gha-workflows has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin feature/simplify-gha-workflows
I need to copy git push --set-upstream origin feature/simplify-gha-workflows manually to execute, so I switching to mouse/trackpad from keyboard **Case #2**
...
➜  extract_ttc git:(feature/simplify-gha-workflows) git push --set-upstream origin feature/simplify-gha-workflows
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 16 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 1.16 KiB | 1.16 MiB/s, done.
Total 6 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
remote:
remote: Create a pull request for 'feature/simplify-gha-workflows' on GitHub by visiting:
remote:      https://github.com/fontist/extract_ttc/pull/new/feature/simplify-gha-workflows 
remote:
To github.com:fontist/extract_ttc.git
 * [new branch]      feature/simplify-gha-workflows -> feature/simplify-gha-workflows
Branch 'feature/simplify-gha-workflows' set up to track remote branch 'feature/simplify-gha-workflows' from 'origin'.
I need to copy https://github.com/fontist/extract_ttc/pull/new/feature/simplify-gha-workflows again to execute open ### Questions - Is there a way to navigate the terminal output of the past commands (without mouse/trackpad)? - Is there some approach that doesn't depend on the terminal app (for example I use iTerm on OSX)? - If there is no solution in the way how I imagined it: what are possible approaches to achieve the same with keyboard only?
Asked by CAMOBAP (270 rep)
Dec 21, 2020, 02:42 PM
Last activity: Jul 16, 2025, 12:11 PM