Short cut for switching directory in Jupyter Lab file browser

Is it possible to switch the directory listing shown in the file browser using a launcher shortcut ?

Right now I can switch directory in the file browser only through clicking on an open notebook’s tab and selecting “Show in file browser”.

I work with multiple directories deep down in a hierarchy, creating workspace for each directory seems like an overkill.

You might be interested in GitHub - jupyterlab-contrib/jupyterlab-unfold: An IDE-like file browser for JupyterLab. It has some rough edges, but it works in general.

1 Like

Thanks for the response.
I can temporary get around this issue by creating symlinks to the directories at the root directory where Jupyter Lab is running.
But it is nice to have a feature where control of file browser can be done through executing a command in the notebook cell.

In that case you want GitHub - jtpio/ipylab: Control JupyterLab from Python Notebooks with Jupyter Widgets 🧪 ☢️ 🐍.

Something like:

from ipylab import JupyterFrontEnd
app = JupyterFrontEnd()
app.commands.execute('filebrowser:go-to-path', {'path': '/'})
# or maybe it should be: (both seem to work)
# app.commands.execute('filebrowser:go-to-path', {'path': '.'})
2 Likes