riscy / shx-for-emacs

An Emacs shell-mode (and comint-mode) extension that enables displaying small plots and graphics and lets users write shell commands in Emacs Lisp.
GNU General Public License v3.0
218 stars 10 forks source link

Incompatibility with dap-ui-repl-mode #32

Open jumper047 opened 1 year ago

jumper047 commented 1 year ago

I encountered an issue with shx-mode and dap-mode REPL - on "enter" press it inters "^M" instead of sending string to interpreter. This issue also was opened in dap-mode repo - https://github.com/emacs-lsp/dap-mode/issues/518

riscy commented 1 year ago

This seems to be similar to #25, where another mode wants to have control of how input is sent.

(More than you want to know: the current heuristic (which unfortunately doesn't address this issue) is that shx-mode will not auto-activate unless RET is bound to comint-send-input (i.e. default behavior) but I think I should also have it check the value of comint-input-sender to ensure shx is a good neighbor.)

The reason why toggling shx off doesn't fix this is because shx tries to set comint-input-sender back to its default value, i.e. (setq-local comint-input-sender (default-value 'comint-input-sender)). But this "default" is not the same as the value set by dap-ui-repl-mode.

jumper047 commented 1 year ago

BTW maybe it's worth to add a variable like shx-ignored-modes?

riscy commented 1 year ago

You're probably right. I've been putting that off because I'm hesitant to maintain a laundry list of incompatible modes (mostly REPLs) but maybe I should give in.

jumper047 commented 1 year ago

I suppose your heuristics is good, I thought about variable as workaround for cases like that - to ease temporarily fixing issue until proper fix will be released

jumper047 commented 1 year ago

Another thing - I think there is another non-expected behavior here, because the issue still exists even if shx mode was disabled. Should advice be deactivated on disabling mode?

riscy commented 1 year ago

Are you testing on the develop branch? (Which I appreciate, btw.)

jumper047 commented 1 year ago

Do you mean emacs dev branch or something else? If you are talking about emacs then it's yes and no - it was dev at the moment I compiled it (last spring I suppose), and I don't upgraded it since then.

riscy commented 1 year ago

The develop branch of shx -- but I just merged the change to shx into the mainline branch, so hopefully the non-expected behavior is resolved?

jumper047 commented 1 year ago

oops, sorry, it's rather uncommon in emacs packages world:) still not checked the fix though, sorry - real life(, but I will check it on weekend

riscy commented 1 year ago

No problem, I appreciate you even being available to confirm. :) If you don't get a chance, that's alright too of course.

jumper047 commented 1 year ago

some time passed Checked the fix and can confirm that it works. Thank you!