From 500687f8d7d5b87ceb33fd959e545746ec9db1ba Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 16 May 2026 04:01:04 -0500 Subject: refactor(integrations): five hygiene fixes from the module-by-module re-review - markdown-config.el: two related fixes on `markdown-preview'. First, the URL was `https://localhost:8080/imp' but simple-httpd serves plaintext on port 8080 -- the browser hit a TLS handshake against a non-TLS listener and the preview never rendered. Changed to `http://' and switched from `browse-url-generic' to plain `browse-url' so the user's default protocol handler picks the browser. Second, the function used to start the network listener as a side effect of opening a preview; that's split into a separate `cj/markdown-preview-server-start' command and `markdown-preview' now signals a `user-error' (with the recovery command in the message) when the server isn't running. - slack-config.el: wrap the `which-key-add-keymap-based-replacements' call in `with-eval-after-load 'which-key'. Matches the pattern other config modules use and means a slow / missing which-key load won't block requiring slack-config. - ai-vterm.el: pass the inner shell-command-string through `shell-quote-argument' before wrapping in the tmux invocation. The default value with embedded double quotes was safe under the prior literal-single-quote wrap, but a user-customized `cj/ai-vterm-agent-command' containing a single quote silently broke the shell parse. Two existing tests updated to tolerate the post-quote escape shape; new regression test asserts a single-quote-bearing custom command survives. - eshell-config.el: scope the `TERM=xterm-256color' override to eshell-spawned processes only via an `eshell-mode' hook that prepends to a buffer-local `process-environment'. The previous global `setenv' at config-time changed `TERM' for every subsequent `start-process' across the Emacs session, so any subprocess (not just eshell pipelines) inherited `xterm-256color' regardless of whether the receiver could interpret the escapes. --- todo.org | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'todo.org') diff --git a/todo.org b/todo.org index 1c215c3e..8c04c955 100644 --- a/todo.org +++ b/todo.org @@ -2356,7 +2356,7 @@ Expected outcome: - Add a small test or manual checklist for the EWW user-agent advice so it does not affect package.el or non-EWW URL callers. -**** TODO [#B] Move Slack which-key registration behind =with-eval-after-load= :cleanup:quick: +**** 2026-05-16 Sat @ 04:00:00 -0500 Moved Slack which-key registration behind with-eval-after-load =slack-config.el= calls =which-key-add-keymap-based-replacements= at top level, while most modules defer which-key registration. If which-key is not loaded or @@ -2366,7 +2366,7 @@ Expected outcome: - Wrap the registration in =with-eval-after-load 'which-key=. - Add a module-load smoke test or byte-compile check if easy. -**** TODO [#C] Remove =httpd-start= side effect from =markdown-preview= :safety: +**** 2026-05-16 Sat @ 04:00:00 -0500 Removed httpd-start side effect from markdown-preview =modules/markdown-config.el:37-51= starts =simple-httpd= inside an interactive command, then opens a browser at @@ -2387,7 +2387,7 @@ config (a defcustom, an alist read from disk, or =host-environment.el='s machine-table) so the module itself is portable. -**** TODO [#B] Fix HTTPS scheme in =markdown-preview= URL :bug: +**** 2026-05-16 Sat @ 04:00:00 -0500 Fixed https→http in markdown-preview + extracted server start =modules/markdown-config.el:45= opens =https://localhost:8080/imp= via =browse-url-generic=, but the @@ -2409,7 +2409,7 @@ disappears. Document the dependency in the module commentary at minimum; better, vendor a copy of =strapdown.js= under =assets/= and serve it from the local =simple-httpd= root. -**** TODO [#C] Reconsider global =TERM=xterm-256color= setenv in =eshell-config= :startup: +**** 2026-05-16 Sat @ 04:00:00 -0500 Scoped TERM=xterm-256color to eshell buffers via process-environment =modules/eshell-config.el:131= calls =(setenv "TERM" "xterm-256color")= at config time inside the =xterm-color= use-package block. That @@ -2421,7 +2421,7 @@ in shells that aren't interpreting them. Move the setenv into the eshell entry hook (=eshell-mode-hook= or =eshell-before-prompt-hook=) so it scopes to eshell processes only. -**** TODO [#C] Quote agent command in =cj/--ai-vterm-launch-command= :safety: +**** 2026-05-16 Sat @ 04:00:00 -0500 Quoted agent command in cj/--ai-vterm-launch-command via shell-quote-argument =modules/ai-vterm.el:236-240= builds the tmux launch command by wrapping =(concat cj/ai-vterm-agent-command "; exec bash")= in -- cgit v1.2.3