I use isend-mode
(see here)
to send (bash) code to an ansi-term
as follows:
1) `M-x ansi-term` # open ansi-term
2) Open buffer with code I want to send to *ansi-term*
3) `M-x isend RET *ansi-term* RET` # => associates code buffer with `*ansi-term*`
Then you can step through code with C-RET
and see the output in ansi-term
.
There are two things that are tedious:
On
M-x isend RET
, the current buffer name is suggested as output where to send the code to, but I never do that. I would like to have*ansi-term*
as default there. This should be rather easy given the definition ofisend-associate
(see the above link, line 262), but I'm not an Elisp programmer (is it simply(setq isend--command-buffer *ansi-term*)
?)Ideally,
M-x ansi-term
in Step 1) would not be necessary. It would be great if callingM-x isend RET *ansi-term*
would automatically open a newansi-term
(unless there's already one open in which case it should go to that) and associate it with the code buffer.Out of interest, is there any other method that can send code from a buffer (.sh file) to an ansi-term (or even 'real' terminal provided by the OS) so that you can step through the code one line at a time or send regions? I didn't find any other ones but
isend-mode
.
M-x isend-associate RET *ansi-term* RET
if I understand correctly?M-x isend
is an alias for that, so also works