Open jeisner opened 6 years ago
Thanks, I think that makes sense. It may take a bit of working out, because of the behaviour that uses an existing server if one is available that can reach the files in question, or starts a new one if necessary. So for multiple files, it needs a bit more smarts to figure out whether and where to launch new servers.
Is it possible that one call to nbopen (on multiple files) would have to launch multiple new servers? If so, then their messages would be mingled on stdout/stderr -- not sure if that's a problem.
Possibly - it depends on how it chooses the directories. At present, if it can't find an existing server to use, it will start a new one either at your home directory, or (for notebooks outside that) at the directory containing the notebook.
If it's passed notebooks in different directories, it would have to choose one of:
Could it launch a server in the directory of the first file, and use relative or absolute pathnames for the other files? (This is a variant of 2 -- use the first file instead of the common ancestor. I think that's more intuitive.)
When this is not possible, I guess it would have to fall back on 1. or 3.
The limitation is that a notebook server can only open notebooks below the directory it's started at - it can't look up to higher directories, or across to sibling directories.
But I imagine that most of the times when someone would try to open multiple notebooks, they'd be in the same folder. So maybe we could avoid most of the complexity, at least at first.
Thanks very much for nbopen. Simple suggestion: It would be nice to permit opening multiple files (in separate browser tabs) with one call to nbopen, like this:
I expected this to work and was surprised when it gave an error.
While it might seem almost as easy to write
these don't actually work because the first call to nbopen may have to open a notebook server, in which case it doesn't terminate until that server is closed. One would have to run the first call in the background.
Also, it is sometimes convenient to have a single command running that mentions a group of related filenames. This can make it easier to use commands like
jobs
andps -f
andpgrep -f
andpkill -f
, which list or match the full command.