Add asynchronous external editor support #17

Manually merged
jabber.developer merged 2 commits from feat/async-editor into master 2025-08-07 01:31:56 +00:00
  • I ran valgrind when using my new feature

How to test the functionality

  • step 1
  • step 2
<!--- Make sure to read CONTRIBUTING.md --> <!--- It mentions the rules to follow and helpful tools --> <!-- For completed items, change [ ] to [x]. --> - [ ] I ran valgrind when using my new feature ### How to test the functionality - step 1 - step 2
jabber.developer added 1 commit 2025-08-06 01:45:56 +00:00
feat(editor): add asynchronous external editor support
Some checks failed
CI / Check spelling (pull_request) Successful in 26s
CI / Check coding style (pull_request) Successful in 55s
CI / Linux (ubuntu) (pull_request) Successful in 15m17s
CI / Linux (debian) (pull_request) Successful in 15m33s
CI / Linux (fedora) (pull_request) Failing after 1m26s
CI / Linux (arch) (pull_request) Failing after 3m58s
66e5aea7ef
The synchronous `get_message_from_editor` blocked the main loop (`prof_run`) while launching an external editor like `vim`, halting network I/O in `session_process_events` and preventing incoming message reception.

Introduced `get_message_from_editor_async` for `cmd_editor` to run the editor asynchronously. It forks and execs the editor in a thread (`editor_thread`), suspending NCurses to free the terminal. The main loop skips `inp_readline` and `ui_update` via a new `background_mode` flag while the editor runs, allowing `session_process_events` to keep the connection alive.

On editor completion, `editor_process` (called per loop iteration) resumes NCurses with `ui_resize`, inserts the result into the readline buffer and clears `background_mode`.

Retained synchronous `get_message_from_editor` for ~20 existing code paths (e.g., `vcard_nickname`) to avoid breaking them.

Tested with `vim` and `nano`: confirms no rendering conflicts, messages received during editing, and seamless resume. Edge cases like editor crashes handled via error logging and seamless resume.
admin force-pushed feat/async-editor from 66e5aea7ef to c4e2e46636 2025-08-07 00:42:42 +00:00 Compare
admin force-pushed feat/async-editor from c4e2e46636 to ad294cdd6d 2025-08-07 01:03:50 +00:00 Compare
admin added 1 commit 2025-08-07 01:27:18 +00:00
Temporarily disable Fedora tests
All checks were successful
CI / Check spelling (pull_request) Successful in 15s
CI / Check coding style (pull_request) Successful in 28s
CI / Linux (arch) (pull_request) Successful in 11m52s
CI / Linux (ubuntu) (pull_request) Successful in 11m59s
CI / Linux (debian) (pull_request) Successful in 12m2s
CI / Check spelling (push) Successful in 17s
CI / Check coding style (push) Successful in 30s
CI / Linux (ubuntu) (push) Successful in 10m9s
CI / Linux (arch) (push) Successful in 12m4s
CI / Linux (debian) (push) Successful in 13m0s
a3e23c3514
They are failing on our runners due to issues with dependency resolution.
jabber.developer manually merged commit a3e23c3514 into master 2025-08-07 01:31:56 +00:00
Sign in to join this conversation.
No description provided.