Fix: normalize kernel path with forward slashes (Windows) - #3023
Merged
Conversation
|
choldgraf
approved these changes
Aug 8, 2026
choldgraf
left a comment
Collaborator
There was a problem hiding this comment.
This feels like a safe change to me, thanks for the comments and keeping this tightly focused
Contributor
|
Excellent — good spot that the paths are unix-like, not platform-specific! |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References and Relevant Issues
Closes #3010
Description
When executing notebooks on Windows, the kernel starts from the root rather than the notebook's directory. On Unix systems, the kernel starts from the notebook's directory. This is because
path.relativereturns native separators (backslashes on Windows), and Jupyter Server API paths are/-delimited. With a Windows path, Jupyter Server silently falls back to the server root.Jupyter server docs explaining the path resolution
And I think this is the actual juypter-server forward-slash code being executed by myst-execute.
I made https://github.com/TimMonko/myst-cwd-repro to demonstrate the issue -- and building with bun (my first time) and running this repo works with the fix.
I'm not sure if I can demonstrate this with a regression test because CI is only Linux it appears, so I guess you could mock the Windows path? Anyways, it's why I left a thorough comment in the code.
I used Deepseek to help me navigate mystmd. To be honest, I've never looked at typescript in my life so please be honest with me.