manateelazycat / aweshell

Awesome shell extension base on eshell with wonderful features!
423 stars 39 forks source link

(tramp-file-name-user (tramp-dissect-file-name default-directory)) returns nil if using aliases #50

Closed d-qoi closed 4 years ago

d-qoi commented 4 years ago

If I use Tramp to to access a remote file and use the aliases defined in .ssh/confg, (tramp-file-name-user (tramp-dissect-file-name default-directory)) returns nil, and the macro epe-colorize-with-face throws an error: concat: Wrong type argument: stringp, nil.

I have temporarily gotten around this by returning a placeholder string if nil is returned.

  "Return remote user name."
  (or (tramp-file-name-user (tramp-dissect-file-name default-directory)) "<alias>"))

I am on Emacs 25.2.2 running Ubuntu 18.04.3, haven't checked to see if this is still an issue on later versions of Emacs.

dylanjm commented 4 years ago

This is an issue as of 28.0.50. The functions in eshell-prompt-extras don't account for a nil user-name value and prevents aweshell from working.

anquegi commented 4 years ago

This is an issue as of 28.0.50. The functions in eshell-prompt-extras don't account for a nil user-name value and prevents aweshell from working.

Thanks I just have the same issue and trying to report this only changing

/sshx:servername:

with /sshx:username@servername

and tada! eshell works again, thanks for creating this awesome package