1

It seems like this would be a ubiquitous desire: capture the output of a command in eshell into a new buffer and when the command is completed, show the buffer in the other window. For example, I just did:

rails g scaffold --help > #<scaffold>

and then I did C-x 4 b scaffold although view-buffer-other-window is probably more what I want here.

Is there already an existing syntax to do this? If not, I'm thinking adding a plus sign:

rails g scaffold --help > #+<scaffold>

It appears that I use eshell-parse-argument-hook to do this?

1 Answer 1

1

In eshell, you can redirect stdout to an emacs buffer in a few different ways.

rails g scaffold --help > (switch-to-buffer "*scaffold*")
rails g scaffold --help >>> #<*scaffold*>

You can name the buffer whatever you want, and it'll be autovivified if it doesn't already exist. You can read more about it at the following links:

Your Answer

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

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