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

Several commands no-op #36

Open
psionic-k opened this issue May 19, 2022 · 4 comments
Open

Several commands no-op #36

psionic-k opened this issue May 19, 2022 · 4 comments

Comments

@psionic-k
Copy link

In situations where intuitive behavior exists, these commands don't do anything:

vterm-toggle-backward
Several vterms are open. Expected this to toggle between them with some negative sort. If no vterm open, give me one.

vterm-toggle-forward
Several vterms are open. Expected this to toggle between them with some positive sort. If no vterm open, give me one.

vterm-insert-cd-show
Expected this command to switch to some available vterm buffer and then run cd to the directory of the file that I was editing. No observed behavior.

vterm-insert-cd
Expected this to do what cd-show does, but without necessarily showing me.

Seems to be a lot of missing behavior. Does it rely on vterms being opened by vterm-toggle? I don't know, but it won't integrate will with other vterm controls if it can't infer the open list of vterms and do something reasonable.

@jixiuf
Copy link
Owner

jixiuf commented May 27, 2022

In situations where intuitive behavior exists, these commands don't do anything:

vterm-toggle-backward Several vterms are open. Expected this to toggle between them with some negative sort. If no vterm open, give me one.

fixed.

vterm-toggle-forward Several vterms are open. Expected this to toggle between them with some positive sort. If no vterm open, give me one.

fixed.

vterm-insert-cd-show Expected this command to switch to some available vterm buffer and then run cd to the directory of the file that I was editing. No observed behavior.

I cann't reproduce vterm-insert-cd-show

vterm-insert-cd Expected this to do what cd-show does, but without necessarily showing me.

vterm-toggle-insert-cd
this command should be called after vterm-toggle, after vterm-toggle is called, you finally foud out the command you want actually is vterm-toggle-cd,then you can just call vterm-toggle-insert-cd.
vterm-toggle-cd= vterm-toggle+ vterm-toggle-insert-cd

@psionic-k
Copy link
Author

Having a look tomorrow

@psionic-k
Copy link
Author

Pulled master and rebuilt.

this command should be called after vterm-toggle, after vterm-toggle is called, you finally foud out the command you want

IMO any vterm command that requires a vterm needs to open one if it doesn't exist. It's counter-intuitive because the user can't know from the command names which ones are intended to be used in which cases. You have to create state if it's necessary and be idempotent when existing state is sufficient.

I did a vterm-toggle-cd-show with one vterm visible and got this error:
and: Symbol’s function definition is void: vterm--backward-char.
This doesn't seem to be stable across vterm versions, which makes sense given the name.

The forward and backward behavior seems to only work with vterms that were created after some vterm-toggle is done. Existing vterms should be included because I use other commands like projectile-run-vterm and just vterm. This shouldn't be too hard since you can hook the mode and filter buffers on first run of commands that need the vterm state. Again, it's just lazy init + idempotency + mode hook for updates.

I have a vterm open. It was not created with a toggle command. I say toggle, I get one that was created with a toggle command. IMO these should integrate.

vterm-toggle-cd again seems to have no idea that another vterm, one opened with projectile-run-vterm is currently visible. This is weird because I have a file open and want to cd to the location, but instead of re-using the available vterm, I get a freshly toggled vterm. I was expecting it would use (window-list) and (window-buffer) and then check the mode in buffer-locals to see if we can use the currently non-busy, visible vterm first.

Happy to test more and begin focusing on individual commands and behavior.

@jixiuf
Copy link
Owner

jixiuf commented Jun 6, 2022

IMO any vterm command that requires a vterm needs to open one if it doesn't exist. It's counter-intuitive because the user can't know from the command names which ones are intended to be used in which cases. You have to create state if it's necessary and be idempotent when existing state is sufficient.

vterm-toggle-insert-cd fixed.

I did a vterm-toggle-cd-show with one vterm visible and got this error: and: Symbol’s function definition is void: vterm--backward-char. This doesn't seem to be stable across vterm versions, which makes sense given the name.

You need upgrade your vterm.el

The forward and backward behavior seems to only work with vterms that were created after some vterm-toggle is done. Existing vterms should be included because I use other commands like projectile-run-vterm and just vterm. This shouldn't be too hard since you can hook the mode and filter buffers on first run of commands that need the vterm state. Again, it's just lazy init + idempotency + mode hook for updates.

fixed.

I have a vterm open. It was not created with a toggle command. I say toggle, I get one that was created with a toggle command. IMO these should integrate.

vterm-toggle-cd again seems to have no idea that another vterm, one opened with projectile-run-vterm is currently visible. This is weird because I have a file open and want to cd to the location, but instead of re-using the available vterm, I get a freshly toggled vterm. I was expecting it would use (window-list) and (window-buffer) and then check the mode in buffer-locals to see if we can use the currently non-busy, visible vterm first.

Happy to test more and begin focusing on individual commands and behavior.

See https://github.com/akermu/emacs-libvterm#directory-tracking-and-prompt-tracking .
You need enable Directory tracking and Prompt tracking or update your term-prompt-regexp,
without that, I don't know whether the buffer is busy or not .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants