Timeline for How to change the tmux working directory with a shell command
Current License: CC BY-SA 4.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 16, 2022 at 9:14 | answer | added | risca | timeline score: 3 | |
| Nov 17, 2020 at 21:41 | answer | added | judu | timeline score: 3 | |
| Nov 17, 2020 at 21:24 | comment | added | Immae |
As a workaround (not sure if the direct way is feasible, I didn’t see how so far), would a solution like this be good for you? - in your script, do tmux update-environment -t . MY_WORKING_DIRECTORY /path/to/directory - At the end of your fish/bash/whatever initialisation script, if [ -n "$MY_WORKING_DIRECTORY" ]; then cd "$MY_WORKING_DIRECTORY"; fi (bash syntax, I don’t know fish at all)
|
|
| Nov 17, 2020 at 21:08 | comment | added | Lucretiel | Correct. Or a directory passed as an argument, but defaulting to the working directory of the script. | |
| Nov 17, 2020 at 21:05 | comment | added | Immae | Just to make sure I understand the question correctly: you’re in a shell inside a tmux session, and you want to change that session "working directory" so that new windows will have the same working directory as the location where you’re running the script? | |
| Nov 11, 2020 at 21:10 | history | asked | Lucretiel | CC BY-SA 4.0 |