X-Debbugs-Cc: monnier@iro.umontreal.ca Eshell lets you put quotes around variable names so that the parser can tell where the name ends, sort of like ${var} in other shells: ~ $ echo $'user-login-name'-suffix user-suffix ~ $ echo $"user-login-name"-suffix user-suffix However, you can't tab-complete variable names when you do this. Here's a fix. I also fixed a couple small issues with completing directory names where it would sometimes complete to "whatever/ ". That extra trailing space isn't helpful, since you'd have to delete it before typing in a subdir. Probably the most controversial part of this patch is in #0002, where I added another dynamic variable 'pcomplete-exit-function' that Pcomplete handlers can set to tell Pcomplete what to do after exiting a completion. Maybe it would be better to have handlers throw some special value for 'pcomplete-completions' that contains this info (sort of like the value that a 'completion-at-point-function' returns). I'm not sure what the best (and most-compatible) way to do this would be...