This Reddit comment suggests something similar to what I tooted previously to use the prompt regexp for better #eshell navigation. In this case, set outline-regexp to the prompt regexp. When you enable outline-minor-mode you’ll be able to collapse / expand commands as you please, or jump back to a certain command with consult-outline
.
https://www.reddit.com/r/emacs/comments/e2u5n9/comment/f918t22/
A small code snippet to configure this:
#emacs