New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rc: Don't hide errors produced by shell commands #2632
base: master
Are you sure you want to change the base?
Conversation
Errors returned by shell utilities will be printed in the *debug* buffer, hiding them prevents users from figuring out what's wrong if commands they're excecuting silently fail.
@@ -28,7 +28,7 @@ Formats of language supported: | |||
fi | |||
|
|||
{ | |||
sed 's/^/^/' "$kak_opt_spell_tmp_file" | eval "aspell --byte-offsets -a $options" 2>&1 | { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stderr goes to /dev/null anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This redirection is redundant, and should not be there in the first place.
@@ -22,7 +22,7 @@ define-command -hidden -params 1.. tmux-new-impl %{ | |||
tmux_args="$1" | |||
shift | |||
if [ $# -ne 0 ]; then kakoune_params="-e '$@'"; fi | |||
TMUX=$tmux tmux $tmux_args "env TMPDIR='${TMPDIR}' kak -c ${kak_session} ${kakoune_params}" < /dev/null > /dev/null 2>&1 & | |||
TMUX=$tmux tmux $tmux_args "env TMPDIR='${TMPDIR}' kak -c ${kak_session} ${kakoune_params}" < /dev/null > /dev/null & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will prevent the command from running detached
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the whole chain of redirection is uncessary, it will work without any of them as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it will work, but the Kakoune server will be blocked until the tmux command finishes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it won't, I've tested those changes and they work? I can close the first client, and the second one will remain usable.
Have you tested the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think we understood each other, the tmux command is going to return relatively quickly, its just sending a command to the tmux server. Yet there is a difference between the previous behaviour, where that tmux command was fired, then forgotten and the shell returned immediately, and the new behaviour would be to wait for that command to return (which, again, is not going to wait for the pane to be closed, just for the command to be acknowledged by the tmux server).
It would be ok not to launch that tmux command in parallel, I merely wanted to point out that this behaviour was changing, as it did not look that was obvious to you (as you did not remove the whole redirection and backgrounding).
@@ -46,7 +46,7 @@ All optional parameters are forwarded to the new window} \ | |||
-shell-completion \ | |||
kitty-repl %{ evaluate-commands %sh{ | |||
if [ $# -eq 0 ]; then cmd="${SHELL:-/bin/sh}"; else cmd="$*"; fi | |||
kitty @ new-window --no-response --window-type $kak_opt_kitty_window_type --title kak_repl_window --cwd "$PWD" $cmd < /dev/null > /dev/null 2>&1 & | |||
kitty @ new-window --no-response --window-type $kak_opt_kitty_window_type --title kak_repl_window --cwd "$PWD" $cmd < /dev/null > /dev/null & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will prevent the command from running detached.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it will work, but the Kakoune server will be blocked until kitty @ new-window ...
finishes.
Errors returned by shell utilities will be printed in the debug
buffer, hiding them prevents users from figuring out what's wrong
if commands they're excecuting silently fail.