-
Notifications
You must be signed in to change notification settings - Fork 135
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
Add eat-eshell shim #668
Add eat-eshell shim #668
Conversation
Sorry for opening a new request. I messed up the branching. |
408e3a5
to
945db9a
Compare
After using this for a week or so I think it mostly works well. I think one improvement would be to not hard code the transition from semi-char-mode into emacs- or char-mode. I think the better option would be to base that choice would be to base it on the active meow state. So, if we enter eat from insert mode, then we should end up in char-mode. If we do it in normal mode, then we should use emacs-mode. I'll throw something together to test tomorrow. |
Ohh, I added some comments to the previous PR, they lost. Well, when adding hook to Also I think we should not do this advice, as it is global runs whenever the command is called, but for eat only. We should avoid global modification whenever possible. |
Yes, this makes sense. I wasn't aware about adding buffer local hooks. This would allow me to remove the maybe switch mode functions. I guess instead of having the advice I could trigger the mode override on I'll try implementing this and we'll see where it gets us. |
I've made some improvements and the result is much nicer. I couldn't come up with a way to avoid adding advice to |
I think we should just remove the advice. |
Could this be handled instead by making the shim a minor-mode with a keymap overriding the The shim could provide a function for doing the emacs-mode pasting that they could bind to it if they want it. |
I realized that if I stop overthinking it and just bind my fancy mode switch yank function in the This should be a much simpler and nicer version of the shim. |
I don't think we should make it complicated and provide any options/docs from shims. If users want to do copy/paste with kill-ring/clipboard they can bind another command just like how people do in normal terminal emulator with |
I think to paste, there's no need to switch to semi char mode first, |
It won't work in emacs-mode as the buffer is read-only. At least this doesn't work for me. The mode swapping in the shim paste function is to work around this. For pasting in insert mode, |
In emacs-mode the cursor can go anywhere, I don't think it's good to call eat-yank there. If we want to adapt it, we should add advice to |
When moving the cursor in emacs mode and pasting with When doing line-editing this works kind of as expected. It is a bit strange in visual programs like say nano, where it will still paste at the original cursor but there won't be any indicator of where that is. I think about this more like copy mode in tmux, where it isn't really for editing, compared to running shell-mode where you can do whatever you want in the buffer and only the last line is handled in a special way. |
I don't want to provide any commands from this shim module as I never consider shimming everything is a good way to go, and a stable solution. So I prefer to let users handle it for now. |
Seems reasonable. |
Moved out the function. Now the shim only handles the mode override and restoring the correct cursor shape after exit. |
Thank you very much! |
If line-mode is implemented at some point for eat-eshell, feature request, then this would probably be a nicer thing to use for normal mode as it would allow you to edit the prompt line as per normal meow usage. If we add a shim for eat itself I would say this is a better mode to use than emacs-mode. |
No description provided.