Is there a way to get the CWD of a terminal tab?


Is there a way to get the CWD of a terminal tab (even if running a process?)


Probably not if you’re running the process but you haven’t run it yet then you could run pwd.


Thanks, @bradydowling! Is there a way to determine whether there’s a process running?


You can list all your running processes with top or ps aux. You can also use the Cloud9 process list by clicking the stats panel in the top right corner of your IDE.


This is a somewhat open question, and there is no good api for it in c9. tries to parse path from prompt, it is possible to get cwd using tmux, and it is also possible to use things like ps, ls -la /proc/<pid>/cwd but it would require special handling on windows.

@kzidane what are you trying to implement? knowing that might help to suggest a better option.


Thanks for the input, @harutyun! Will take a look at the other options.

This is to connect an “Open File” file dialog, that we created, and the focused terminal tab, if any, to make it easier to, say, change directories in the terminal, and have the file dialog open at the terminal’s CWD, when it shows up.

Probably we’ll do the same for the “Save As” dialog too.