I'm working with a project that has a pre-commit hook that outputs an "animated" progress bar and updates the output to show which step is completed. In the magit-process buffer it shows every frame in the output window rather than in-place as in the terminal. Is it possible to get this to work in the emacs buffers?

  • 1
    Emacs buffers are not terminal emulators, so emulating this will require implementing what that hook is exactly making use of.
    – wasamasa
    Commented Apr 18, 2017 at 18:47

1 Answer 1


You will need to read the manual entries on process handling. Particularly C-hig (elisp) Output from Processes and (elisp) Sentinels

magit-start-process returns a process object with magit-process-sentinel and magit-process-filter attached, and actually mentions that these can be overridden (e.g. with 'after' advice).

term.el's term-exec uses term-sentinel and term-emulate-terminal to handle the process running in the terminal.

One suspects that you could integrate the term behaviour with the magit process handling, but you would surely need to experiment with this yourself. I have no idea whether there are any conflicts that you would need to deal with, or what sort of complications you may encounter.

You might alternatively, as wasamasa comments, implement a custom filter which handles only the specific features that are required. If you're happy to ascertain the control codes which specifically need to be handled, and figure out what needs to be done to support them.

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.