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

Prevent errors when runner is closed by something other than vimux #237

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

Conversation

mvanderkamp
Copy link
Member

As seen in #236, if the runner was already manually closed when we call VimuxCloseRunner we get the following error:

Error detected while processing function VimuxCloseRunner[2]..VimuxTmux[8]..function VimuxCloseRunner[2]..VimuxTmux:
line    8:
E605: Exception not caught: Tmux command failed with message:can't find pane: %19^@
Error detected while processing function VimuxCloseRunner:
line    2:
E171: Missing :endif

This is an annoyance for people who use VimuxCloseOnExit. The error could spread to other commands as well, since the error prevents vimux from unsetting VimuxRunnerIndex, leading other commands to believe the runner is still available.

The error can occur in other contexts too, as seen in #229.

We generally only check if the VimuxRunnerIndex variable is defined before attempting to interact with the runner. This variable is only unset if vimux closes the runner, so any time anything else loses the runner we will get errors.

We have some options:

  1. Always check for the existence of the runner before interacting with it.
  2. Add try-catch blocks around each command to check for these errors.

I think for now I'll just enhance the checks we already have to make sure that the runner actually exists, rather than just checking for the index variable's existence.

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.

1 participant