This patch adds support for outline-minor-mode to Eshell. When enabled, this will just add outline buttons to the prompt (as the top level), and one to the start of the output (as level 2). The Eshell side is hopefully fairly straightforward, but the outline.el part probably warrants a close review. The changes in outline.el are all there to support outline headings that are just a newline and nothing else. This is important for both the output (you might call a command that prints a newline as the first character), and the prompt (the first character of your prompt could be a newline as a way of separating the prompt from the output just above it).[1] Mainly, the changes in outline.el are about checking to see if the character *before* point is invisible (i.e. part of a collapsed node). This way, if point is at the beginning of the output, and you collapse that node, outline.el still considers you to be on a heading. (Without these changes, cycling a node doesn't work correctly.) I'm open to adding regression tests here since the logic is pretty subtle, but I didn't see any existing ones for outline.el and it's not immediately obvious the best way to test its behavior. Let me know if anyone has ideas though. [1] In the prompt case, a different way to solve this would be to treat the start of the heading as the first non-empty line. That doesn't work for output though since *all* lines could be empty.