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

feat: add targeted communication with the yazi instance (opt-in) #225

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

mikavilpas
Copy link
Owner

This is a technical change with no change in features for the end user. Right now you can opt in to trying it out by setting use_yazi_client_id_flag = true in your config (run :checkhealth yazi afterwards).

This will probably be the default mode of communication in the future.

Before this change, real time communication with the embedded yazi instance has been possible, but it has had some limitations:

  • yazi.nvim had the possibility of sending commands to yazi, but the communication has been global, meaning that all yazi instances running on the system have been able to receive these messages. This has been too dangerous to implement, as making yazi do any actions could have unintended side effects if multiple yazis execute the same actions, potentially in different directories on the system.
  • similarly, receiving events from yazi has been limited to receiving events from all yazis running on the system. This has not been a problem so far since the events we use (rename, delete, trash, move, cd, hover, bulk) are not dangerous, and typically the user only focuses on one yazi.nvim instance at a time anyway.

This change removes this limitation from future features by giving the yazi instance shown by this plugin a unique identifier. This identifier can later be used to send and receive messages with this specific yazi instance.

See these for more information and context:

This is a technical change with no change in features for the end user.
Right now you can opt in to trying it out by setting
`use_yazi_client_id_flag = true` in your config (run `:checkhealth
yazi` afterwards).

This will probably be the default mode of communication in the future.

Before this change, real time communication with the embedded yazi
instance has been possible, but it has had some limitations:

- yazi.nvim had the possibility of sending commands to yazi, but the
  communication has been global, meaning that all yazi instances running
  on the system have been able to receive these messages. This has been
  too dangerous to implement, as making yazi do any actions could have
  unintended side effects if multiple yazis execute the same actions,
  potentially in different directories on the system.
- similarly, receiving events from yazi has been limited to receiving
  events from all yazis running on the system. This has not been a
  problem so far since the events we use (rename, delete, trash, move,
  cd, hover, bulk) are not dangerous, and typically the user only
  focuses on one yazi.nvim instance at a time anyway.

This change removes this limitation from future features by giving the
yazi instance shown by this plugin a unique identifier. This identifier
can later be used to send and receive messages with this specific yazi
instance.

See these for more information and context:

- sxyazi/yazi#989 (comment)
- sxyazi/yazi#1305
@mikavilpas mikavilpas merged commit 8114817 into main Jul 19, 2024
14 checks passed
@mikavilpas mikavilpas deleted the listen-to-specific-yazi branch July 19, 2024 06:10
mikavilpas added a commit to mikavilpas/dotfiles that referenced this pull request Jul 19, 2024
mikavilpas added a commit that referenced this pull request Jul 19, 2024
There was a bug in opting in to the feature from 8114817 (feat: add
targeted communication with the yazi instance (opt-in) (#225)). Even if
you had not set `use_yazi_client_id_flag = true` in your config, the
newest yazi was still required.

This commit fixes that bug by removing the passing of the `yazi_id`
(roll forward style). Later changes can still utilize the feature and
build on top of this.
mikavilpas added a commit that referenced this pull request Jul 19, 2024
There was a bug in opting in to the feature from 8114817 (feat: add
targeted communication with the yazi instance (opt-in) (#225)). Even if
you had not set `use_yazi_client_id_flag = true` in your config, the
newest yazi was still required.

This commit fixes that bug by removing the passing of the `yazi_id`
(roll forward style). Later changes can still utilize the feature and
build on top of this.
mikavilpas added a commit that referenced this pull request Jul 19, 2024
There was a bug in opting in to the feature from 8114817 (feat: add
targeted communication with the yazi instance (opt-in) (#225)). Even if
you had not set `use_yazi_client_id_flag = true` in your config, the
newest yazi was still required.

This commit fixes that bug by removing the passing of the `yazi_id`
(roll forward style). Later changes can still utilize the feature and
build on top of this.
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