1

When you are building some code (for example with gcc) you usually have lots of lines of output information. If there are errors, the first one usually located somewhere in the middle of output and I have to scroll up manually to find it. It really annoys.

I'm wondering if there is a way to scroll up automatically or a way to freeze terminal scrolling after first error.

I could write a simple program to detect line with the first error, but it's still a question how to make terminal jump there.

2
  • If I expect multiple errors, I redirect the whole compiler output to a .err file, and open it: one terminal to fix the sources, another to move around the errors. I usually fix errors from the bottom up, to avoid changing line numbers in the source that are provided with the errors. Feb 1, 2022 at 14:06
  • That's something that some specific terminal emulator might implement, but: (a) there's no general solution, and (b) likely the answer for your specific terminal is found only by reading its source code. Feb 1, 2022 at 21:57

1 Answer 1

1

One solution would be to work with Visual Studio Code, as it has a shortcut to jump between the passed terminal commands (the things you write and then press enter).

On Mac Os it is Command + Up / Down. You have to wait until the command is executed before jumping.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.