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

Feature Request: Support for Windows Communication via Volatile Text File Transfer #16

Open
mathe00 opened this issue Oct 6, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@mathe00
Copy link
Owner

mathe00 commented Oct 6, 2024

Description:
Currently, the plugin is limited to Linux users due to the use of sockets for communication between TypeScript and Python. To make the plugin accessible to Windows users, this request proposes to replace the current communication method with a "volatile" transfer file. This file will operate in plain text, using simple delimiters to structure requests and responses.

Proposed Solution:

  • Use a text file as a means of communication, which will serve as a "transfer server."
  • The file will be created in the vault directory, ensuring it is easily accessible.
  • Communication will occur in plain text, without utilizing JSON format. Requests and responses will be framed by simple delimiters:
    • Start and end of request: ---BEGIN-[action]--- and ---END-[action]---
    • Variable/element separators: || to delimit different values or elements to be transferred.
  • Files will be cleared immediately after the request is processed, ensuring no leftover data remains in the vault.

Example of Proposed Communication Structure:

---BEGIN-get_active_note_absolute_path---
/path/to/active/note.md||success: true
---END-get_active_note_absolute_path---

Advantages:

  • Simplicity and Rawness: By using a plain text file with delimiters, we maintain a basic and direct communication logic, similar to that of text mode sockets under Linux.
  • Cross-Platform Compatibility: This method provides a straightforward solution for Windows users, enabling them to utilize the plugin for the first time.
  • Immediate Cleanup: By deleting transfer files as soon as the request is processed, we minimize the risk of conflicts or residual data in the vault.

Implementation Considerations:

  • Implement appropriate error handling during file operations (e.g., checking if files exist, managing read/write permissions).
  • Add a simple pause or check mechanism to ensure that TypeScript does not attempt to read the response file before it is written by the Python script.
  • Clearly document the operation, including how to configure the transfer file's location if necessary.

Conclusion:
This feature would enable Windows users to use the plugin, breaking the current limitation that confines its usage to Linux environments only. Adopting a plain text file transfer method aligns with our goal of enhancing cross-platform compatibility while maintaining a straightforward approach.

@mathe00 mathe00 self-assigned this Oct 6, 2024
@mathe00 mathe00 added the enhancement New feature or request label Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant