-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Directory change dos not persist between code blocks executed on the same session #32
Comments
Hello, thanks for the report. So, actually, sessions are not supported for the To bring support, we would have to run a process in the background and feed it input. I believe this would maintain the CWD. |
I didn't pay attention to the notice this works for Python and Pycon only :-/. Anyhow, it would be useful to stick the current working directory across code blocks running in the same session. However, for my use case, I prefer a single command output only. That is, show the last command's output. ps- Reading in the unedited comment about hiding, though, gives me an idea to work-around my current use-case without using a session. In a How-To, I am trying to say something like :
So, for now, maybe the second command can be ```bash exec="true" source="above"
cd somedirectory/ # markdown-exec: hide
somecommand . --some-option
``` while hiding the first line (?). Will try. |
That seems to work nicely for my use case. Needless to repeat, this plugin is very useful! Thank you @pawamoy. |
Since sessions are not yet supported for Bash code blocks, I'll close this issue in favor of #53. |
Description of the bug
Given that the current working directory is part of the state when executing code in a shell,
then the state does not persist between executed code blocks when changing to another directory.
To Reproduce
Enter in a directory, print its name and list files inside it :
OR
Print the current directory's name (or list its content), expected to be
somedirectory
(or the same content) from the previous commands :Expected behavior
Given that the current working directory is part of the state, executing subsequent code blocks on the same session should remember previously executed code blocks that change the directory.
Environment information
markdown-exec
v1.8.0The text was updated successfully, but these errors were encountered: