I'm glad you're investigating, Michael! Interesting that changing tramp-verbose avoids the problem. Sounds like that, in itself, might be a lead on the problem? In any case, I do have a good workaround, which I'm sure you saw the reply, in the follow-up I sent just a moment ago to you and emacs-devel. For the sake of the bug transcript I'll repeat the substance of the message here: I actually have a workaround, and the premise of it resides in the special conditions I included for the repeating the problem. In order to repeat the problem, you have to specifically use a default-directory that is set to the remote+sudo+homedir format, and not allow something like `(cd path)' to first resolve the home directory to an explicit path. So there's my workaround, for multishell - use `(cd path)', rather than directly setting default-directory. Upshot is that I believe that there still is a bug worth unravelling [especially since it involves an aggravating and elusive "Selecting deleted buffer" event], in the way that shells start when default-directory is set to remote+sudo+homedir format, but I can avoid that by using `cd'. Ken On Sun, Jan 24, 2016 at 12:48 PM, Michael Albinus wrote: > Ken Manheimer writes: > > Hi Ken, > > > Tramp fails to start a remote shell when the remote path is exactly of > > the form '/ssh:host|sudo:root@host:'. It fails with a message in the > > minibuffer, "Selecting deleted buffer". > > > > To reproduce the error: > > > > * Start emacs with -Q > > * In any buffer (*scratch* is fine): > > M-Esc (setq default-directory > > "/ssh:example.com|sudo:root@example.com:") > > * In that same buffer, Esc-x shell > > > > This fails (with "Selecting deleted buffer") for me in the version of > > emacs listed in the bug report and more recent versions, which I > > compiled, eg: GNU Emacs 24.5.50.1 (x86_64-apple-darwin14.5.0, NS > > apple-appkit-1348.17) of 2015-12-16 on twist.myriadicity.net. > > > > I can't get a backtrace for it, even if I set debug-on-error and > > signal-on-error. > > Same here, hard to debug. The error doesn't happen if tramp-verbose is > less than 3 prior calling M-x shell. So maybe you bind it temporarily to > 2 in your package, as workaround. > > I'll continue to debug. > > Best regards, Michael. >