Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lenormf
Copy link
Contributor

@lenormf lenormf commented Dec 13, 2018

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.

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 | {
Copy link
Owner

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

Copy link
Contributor Author

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 &
Copy link
Owner

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works here.

Copy link
Contributor Author

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.

Copy link
Owner

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.

Copy link
Contributor Author

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?

Copy link
Owner

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 &
Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works here.

Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants