You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The kernel only stores the resolved path. We used to set PWD as well so the shell would have the original path, but that doesn't seem to be there anymore. I'll have to figure out if it was removed by mistake or if there was a reason.
I was a bit confused by this at first -- what does it matter what the kernel stores, if I provide the path manually? -- but then I realized tmux probably does something akin to this...
... and that also lands me in foo, even though I asked for bar. Because how else would I inform an arbitrary process about the current working directory, other than having inherit it via what the kernel says it is. Thanks for making that clearer in my mind.
Thank you for the quick response! The patch fixes the issue, but only partially -- as long as I provide an absolute path. So new-window -c /absolute/path/to/bar lands me in bar, but new-window -c relative/path/to/bar still lands me in foo. Is that expected?
@danjenson Having read through nushell/nushell#5050, that seems to be an issue with nushell failing to communicate the working directory in a standard way. Not only tmux is affected, but Tilix and other terminal emulators too. And conversely, other shells work perfectly fine in all of these.
So I don't think it's a tmux issue, or related to what we're discussing here.
but new-window -c relative/path/to/bar still lands me in foo. Is that expected?
I guess for that to work, tmux would first have to read PWD from the shell's environment and set the path relative to that?
On Fri, 13 May 2022, 21:29 David Lukes, ***@***.***> wrote:
Thanks for looking into this!
The kernel only stores the resolved path.
I was a bit confused by this at first -- what does it matter what the
kernel stores, if I provide the path manually? -- but then I realized tmux
probably does something akin to this...
import osos.chdir("bar")os.execl("/bin/bash", "/bin/bash")
... and that also lands me in foo, even though I asked for bar. Because
how else would I inform an arbitrary process about the current working
directory, other than having inherit it via what the kernel says it is.
Thanks for making that clearer in my mind.
—
Reply to this email directly, view it on GitHub
<#3186 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACKI476WQIS35TTL76EU2DVJ23RXANCNFSM5V3MOYTQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
Activity
nicm commentedon May 13, 2022
The kernel only stores the resolved path. We used to set
PWDas well so the shell would have the original path, but that doesn't seem to be there anymore. I'll have to figure out if it was removed by mistake or if there was a reason.dlukes commentedon May 13, 2022
Thanks for looking into this!
I was a bit confused by this at first -- what does it matter what the kernel stores, if I provide the path manually? -- but then I realized tmux probably does something akin to this...
... and that also lands me in
foo, even though I asked forbar. Because how else would I inform an arbitrary process about the current working directory, other than having inherit it via what the kernel says it is. Thanks for making that clearer in my mind.nicm commentedon May 14, 2022
I think the
PWDchange was lost in the merge of thespawn.cchange, so I think we can add it back, please try this: x.diff.txtdlukes commentedon May 14, 2022
Thank you for the quick response! The patch fixes the issue, but only partially -- as long as I provide an absolute path. So
new-window -c /absolute/path/to/barlands me inbar, butnew-window -c relative/path/to/barstill lands me infoo. Is that expected?danjenson commentedon May 14, 2022
I'm also seeing problems with -c not being respected at all in tmux3.2a, using nushell 0.62.0
dlukes commentedon May 15, 2022
@danjenson Having read through nushell/nushell#5050, that seems to be an issue with nushell failing to communicate the working directory in a standard way. Not only tmux is affected, but Tilix and other terminal emulators too. And conversely, other shells work perfectly fine in all of these.
So I don't think it's a tmux issue, or related to what we're discussing here.
I guess for that to work, tmux would first have to read
PWDfrom the shell's environment and set the path relative to that?Tmux: Inform about actual PWD
nicm commentedon May 17, 2022
Try this to do relative paths please: y.diff.txt
dlukes commentedon May 17, 2022
That works like a charm, thank you very much!
nicm commentedon May 20, 2022
Applied now, thanks!
github-actions commentedon Jun 20, 2022
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
nicm commentedon Oct 11, 2022