On 12/21/2022 1:54 AM, Michael Albinus wrote: > And when they want to use another value? (null-device) returns > "/dev/null" for local default-directory's if you're not on MS > Windows. On MS Windows, it returns "NUL". Right. The intent is for the virtual name for the null device to be the same in Eshell no matter what the system really calls it. On non-MS systems, this shouldn't actually be necessary, since you could just write to the *real* /dev/null. The virtual target in Eshell is just so that /dev/null also works on MS Windows/DOS. However, I would have thought that you could write to NUL on MS Windows without any special handling. The Emacs manual has this to say: "[On MS Windows,] referencing any file whose name matches a DOS character device, such as NUL or LPT1 or PRN or CON, with or without any file-name extension, will always resolve to those character devices, in any directory. Therefore, only use such file names when you want to use the corresponding character device." I'd expect that to mean that if you opened a buffer and tried to save it as "NUL", it would just work, but instead I get: Write error: Bad file descriptor, c:/NUL With that in mind, here are two patches (one for 29 and one for master) to let Eshell handle both "/dev/null" and (on MS systems) "NUL". That way, users get the best of both worlds.