-
Notifications
You must be signed in to change notification settings - Fork 129
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
Bookmarks section causing TRAMP to open remote connections #408
Comments
Hi @jdm204, I'm not familiar with TRAMP but the only functions that we are using from Are you sure is a bookmark issue? |
I am having the same issue with remote projects also. |
Thanks for looking into this @ricardoricho, I am confused because I have
if I uncomment bookmarks, I have the issue. |
I just tried setting I'm not proficient at elisp so apologies in advance but is there any chance |
I'm sorry @jdm204 but I couldn't reproduce the bug. I created two bookmarks, one with sudo and other with ssh, restarted Emacs and everything is good, it didn't ask for any password. @jeslie0 which Emacs version do you have? I'm in Emacs 28.2 for mac. Maybe it has something to do with a newer version.
That lambda ( |
I'm using Emacs 29.0.50. I will make a minimal working example and see if it fails there, however I have done the following tests to see when it works:
|
Even with a minimal working example, I get the same results as above. I also have noticed that after the first time I launch emacs and enter my ssh key passphrase, restarting Emacs causes me to not be prompted. Maybe the key is cached somewhere? |
One last thing, using my minimal example, I am prompted for my ssh passphrase when using Emacs 28.2 also. I am also asked for passphrase for the /ssh:user@localhost: bookmark. I imagine I wasn't before due to the key being cached. |
I noticed I was having the same issue with consult-dir and remote files. It seems like the issue is caused by using file-directory-p. karthink/consult-dir#22 |
I think I've got the same problem as @jeslie0: Dashboard stopped working after I added a remote/Tramp project to my project list. If I remove the Tramp project from my Here's a (redacted) trace after running
I don't get prompted for a password by Tramp, but that is probably because I wasn't connected to the VPN when I started my Emacs. From the trace, I see a call to
I used (use-package dashboard
:after (project all-the-icons)
:init
;; Overwrite the function that checks projects because it tries to
;; see if the project still exists, but that doesn't work well for
;; remote (Tramp) projects, especially those behind a VPN. See
;; https://github.com/emacs-dashboard/emacs-dashboard/issues/408#issuecomment-1752014811
(defun lck/dashboard-projects-backend-load-projects ()
"Depending on `dashboard-projects-backend' load corresponding backend.
Return function that returns a list of projects. LCK: Removed check for zombie projects"
(cl-case dashboard-projects-backend
(`projectile
(require 'projectile)
(dashboard-mute-apply (projectile-cleanup-known-projects))
(projectile-load-known-projects))
(`project-el
(require 'project)
(project-known-project-roots))
(t
(display-warning '(dashboard)
"Invalid value for `dashboard-projects-backend'"
:error))))
(advice-add 'dashboard-projects-backend-load-projects :override 'lck/dashboard-projects-backend-load-projects)
:config
(dashboard-setup-startup-hook)
:custom
;; Set the groups and number of items per group
(dashboard-items '((recents . 10)
(projects . 5)
(bookmarks . 5)
))
;; Show projects known to Emacs' built-in project.el, not those
;; managed by the projectile package.
(dashboard-projects-backend 'project-el)
(dashboard-projects-show-base 'align)
;; Use icons from all-the-icons theme instead of the default nerd-icons
(dashboard-icon-type 'all-the-icons)
(dashboard-set-heading-icons t)
(dashboard-set-file-icons t)
;; Display alternate Emacs logo
(dashboard-startup-banner 'logo)
) |
Great @lckarssen, thanks for your comment. Would you like to open a PR? |
We could probably just wrap with (dashboard-mute-apply
(ignore-errors
(dashboard-funcall-fboundp #'project-forget-zombie-projects))) |
I don't think it will work. The main issue is that |
I tested @jcs090218's suggestion and that works too. So I guess the question is: why is The two approaches could differ in one important way: my approach doesn't change the user's project list file. I'm not sure if ignoring the errors when calling |
Sorry, I am not very familiar with tramp.
Can you elaborate on the use case of this? I've added this since I don't think dashboard should show any ghost entries (not only the project list). 🤔 |
I'm using project.el to keep a list of my (mostly Git based) projects. Most of the time I work on the code locally on my PC, but, given that my projects often are (bioinforrmatics) pipelines that take several hours to run, with large data files, it is often most convenient to use Tramp to make code changes on the compute cluster itself and immediately test them there. In my specific case, Dashboard stopped working because the project I had most recently added was on a remote server that was behind a VPN, to which I wasn't connected at the time. In general, however, even without VPNs, I'd say it is problematic if Dashboard tries to see if a remote file or project exists by connecting to that remote location. Yes, it would be great if the list of recent files or projects is accurate/up-to-date and without ghost entries. This should work fine locally. Tramp connections, however, are often to remote hosts over SSH, which means the user is asked for a password or SSH key passphrase when e.g. I think @ricardoricho made a good point when he said it isn't Dashboard's responsibility to make sure the lists are up-to-date. It is the user who knows/should know best and who should take care of cleaning up any ghost entries. I never (knowingly) ran into this, but I wouldn't like it if my |
Ah, okay. Thanks for the long explanation! I'll make some changes to fix this. I think it would be great if we had a symbol indicating the ghost entry. 🤔 |
I have make it into an option by adding a new custom variable |
I just tested the current Applying |
Good catch! I've applied the fix in f034bd5. |
Great! That worked. 👍 🙏 Thanks for the quick responses! |
My emacs version:
GNU Emacs 29.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2022-11-05
During startup, enabling the bookmarks section causes TRAMP to open a remote to connection for bookmarks which have a remote path, and so prompts for a password etc.
When I run
bookmark-all-names
andbookmark-get-filename
for a remote bookmark it doesn't seem to open a connection, so it seems that it shouldn't be necessary to do so to start up the dashboard.The text was updated successfully, but these errors were encountered: