I am trying configure the initial JupyterLab workspace for a Binder server. The desired workspace consists of a terminal tab docked to the top of the screen, and a notebook to the bottom of the screen (for students to run through some examples). I can successfully load my workspace.json file, using either the start or postBuild files, but I am having some difficulty loading a terminal consistently. Sometimes, it works fine (terminal on top, notebook on bottom). Other times, the terminal tab briefly loads then disappears (notebook then becomes full page), but the terminal is still running (present in the Running Terminals and Kernels menu). Most of the time the terminal just shuts down entirely when loading into the server. Am I missing something simple?
From what I can interpret, the issue I seem to be having is that the terminal “restarts” (?) after JupyterLab loads, causing terminal-1 to disappear in the Running Kernels and Terminals menu and reappear after ~5-10 seconds. This causes the terminal-1 tab to disappear from where it was docked. If I import the same workspace twice, and switch to the second workspace after the terminal reappears in the menu, the layout is fine. Sometimes, if JupyterLab loads slowly, the initial workspace loads as intended. I have tried including the workspace file in a “.jupyter/lab/workspaces/” directory in the GitLab repo instead of importing it, but that does not solve the issue of “terminal-1” disappearing/reappearing.
My current workaround is to include a link in the notebook that reloads the secondary workspace URL for the current JupyterHub user, for the majority of cases where the workspace does not load correctly the first time. I still don’t understand why this is necessary, but this is my first time using Binder.