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

Unable to remove /su:user@host:/ part when using counsel-find-file from file opened as root #2548

Open
ngleb opened this issue May 7, 2020 · 3 comments

Comments

@ngleb
Copy link

ngleb commented May 7, 2020

Hi!
I'm recently switched to counsel and I have a strange issue with counsel-find-file. I often use Tramp mode to edit files as root via su:

  1. Emacs is open at $HOME, so there's no Tramp in use. Press C-x C-f, prompt is ~/
  2. Type //
  3. Type su://
  4. Enter password, then I get this prompt /su:user@host:/
  5. Proceed with path to a file, e.g. /su:user@host:/etc/hosts and hit RET to open the file.
  6. Now I need to open another file as a regular user. Press C-x C-f, now the prompt looks like this: /su:user@host:/etc/. And this is where problem begins: I cannot remove /su:user@host:/etc/ with Backspace or with //. Only pressing ~~ helps, but then I am at the $HOME.

Is this expected behaviour?

@Macavirus
Copy link

👍 to this, seeing same issue.

@abo-abo
Copy link
Owner

abo-abo commented May 9, 2020

Is this expected behaviour?

This is expected. The reasoning is that // brings you to the root of whatever host you are on right now.

  • You can press / C-j to enter the root of localhost
  • You can press ~~ to enter your home on localhost and then navigate to root.

Ideas on improvement are welcome, especially if we don't have to sacrifice the old functionality.

@io12
Copy link

io12 commented Feb 12, 2021

Maybe pressing /// can jump to the root of localhost? I feel like that would be intuitive enough for people who want to do this to discover it by accident.

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

4 participants