You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the outcome of invoking recipe foo in these different approaches:
in terminal (in this example zsh opened in vterm):
when you invoke M-x compile with just --justfile /tmp/foo/justfile foo:
-*- mode: compilation; default-directory: "/tmp/foo/" -*-
Compilation started at Wed Jun 29 17:24:08
just --justfile /tmp/foo/justfile foo
5/5
DONE
Compilation finished at Wed Jun 29 17:24:13
when you invoke justl-exec-eshell on recipe foo
Welcome to the Emacs shell
/tmp/foo $ just foo
5/5
DONE
/tmp/foo $
when you invoke justl-exec-recipe on recipe foo:
Just target execution started at Wed Jun 29 17:26:59
1/5^M2/5^M3/5^M4/5^M5/5
DONE
Target execution finished at Wed Jun 29 17:27:04
As far as I understand the filter used with subprocess handling output of just doesn't handle carriage return in special way that's way justl-exec-recipe behaves differently. If you however do the following change:
diff --git a/justl.el b/justl.el
index 89b4dd8..b7694ee 100644
--- a/justl.el+++ b/justl.el@@ -349,7 +349,7 @@ ARGS is a plist that affects how the process is run.
(setq-local justl--justfile (justl--justfile-from-arg (elt command 1)))
(run-hook-with-args 'compilation-start-hook process)
- (set-process-filter process 'justl--xterm-color-filter)+ (set-process-filter process 'compilation-filter)
(set-process-sentinel process sentinel)
(set-process-coding-system process 'utf-8-emacs-unix 'utf-8-emacs-unix)
(pop-to-buffer buf)))))
it'll work as other ways to invoke recipe, namely it'll produce:
Just target execution started at Wed Jun 29 17:26:59
5/5
DONE
Target execution finished at Wed Jun 29 17:27:04
Is there a good reason to not use compilation-filter? If you are worried about handling coloring of the output it can be done with (add-hook 'compilation-filter-hook 'ansi-color-compilation-filter).
Special handling of carriage return so that the previously printed line is erased makes sense in a lot of practical applications, for instance with recipes invoking rsync --progress.
The text was updated successfully, but these errors were encountered:
Is there a good reason to not use compilation-filter? If you are worried about handling coloring of the output it can be done with
(add-hook 'compilation-filter-hook 'ansi-color-compilation-filter).
Yeah, you're right. I believe we can drop the whole xterm-color dependency itself. Can you send a PR for the same ?
Consider the following justfile:
Consider the outcome of invoking recipe
foo
in these different approaches:M-x compile
withjust --justfile /tmp/foo/justfile foo
:justl-exec-eshell
on recipefoo
justl-exec-recipe
on recipefoo
:As far as I understand the filter used with subprocess handling output of
just
doesn't handle carriage return in special way that's wayjustl-exec-recipe
behaves differently. If you however do the following change:it'll work as other ways to invoke recipe, namely it'll produce:
Is there a good reason to not use
compilation-filter
? If you are worried about handling coloring of the output it can be done with(add-hook 'compilation-filter-hook 'ansi-color-compilation-filter)
.Special handling of carriage return so that the previously printed line is erased makes sense in a lot of practical applications, for instance with recipes invoking
rsync --progress
.The text was updated successfully, but these errors were encountered: