We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3eaea4b commit 65b06aaCopy full SHA for 65b06aa
jupyter_server/terminal/api_handlers.py
@@ -1,4 +1,5 @@
1
import json
2
+import os
3
4
from tornado import web
5
@@ -26,6 +27,15 @@ def post(self):
26
27
"""POST /terminals creates a new terminal and redirects to it"""
28
data = self.get_json_body() or {}
29
30
+ # if cwd is a relative path, it should be relative to the root_dir,
31
+ # but if we pass it as relative, it will we be considered as relative to
32
+ # the path jupyter_server was started in
33
+ if "cwd" in data.keys():
34
+ if not os.path.isabs(data["cwd"]):
35
+ cwd = data["cwd"]
36
+ cwd = os.path.join(self.settings["server_root_dir"], cwd)
37
+ data["cwd"] = cwd
38
+
39
model = self.terminal_manager.create(**data)
40
self.finish(json.dumps(model))
41
0 commit comments