schischi / xcwd

A simple tool that prints the current working directory of the currently focused window
Other
293 stars 32 forks source link

Issue with terminals running as separate processes. #23

Open chhajedji opened 4 years ago

chhajedji commented 4 years ago

Hello,

I found my problem already addressed in README. But still I would request for an explanation of the issue.

I am using konsole as my terminal emulator. I have unset this option to "Run all Konsole windows in a single process". And it is verified as I get multiple PID with pgrep konsole when multiple windows are open.

image

My issue is that when I do a readlink /proc/$PID/cwd, it always gives path to $HOME directory. So why doesn't it get updated there? To get PID:

xdotool getwindowpid "$(xdotool getactivewindow)"

Another question which you might be able to answer is in a single instance of urxvt, pgrep urxvt gives 2 PIDs (another question, why?), and the actual cwd is stored in /proc/"$(($FIRSTPID+2))"/cwd!

image

This is not an "issue" but some queries which are related to this project. I didn't find appropriate support for these queries till date and stumbled upon this project so thought this might be a good place to ask!