Skip to content

Prevent exception on restore in multiplexer env#17

Open
weierophinney wants to merge 1 commit intodanielcopper:mainfrom
weierophinney:fix/16-get_foreground_process_name
Open

Prevent exception on restore in multiplexer env#17
weierophinney wants to merge 1 commit intodanielcopper:mainfrom
weierophinney:fix/16-get_foreground_process_name

Conversation

@weierophinney
Copy link

Restore can fail when called in a multiplexer environment.

pane:get_foreground_process_name() is documented as returning nil when run in the multiplexer of via SSH. This means that the foreground_process variable may be nil when the conditional that is searching it as if it were a string will instead raise an exception as it cannot call that operation on nil.

To resolve the error, this patch checks for a non-nil value at the start of the conditional.

Fixes #16

…tiplexer

`pane:get_foreground_process_name()` is documented as returning `nil` when run in the multiplexer of via SSH.
This means that the `foreground_process` variable may be `nil` when the conditional that is searching it as if it were a string will instead raise an exception as it cannot call that operation on `nil`.

To resolve the error, this patch checks for a non-nil value at the start of the conditional.
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.

Restoring does not work with multiplexer panes

1 participant