mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-26 07:57:59 -04:00
slave: chdir to / after spawning the client application
With this patch, the terminal process now changes PWD to / after spawning the client application. This ensures the terminal process itself does not "lock" a directory. For example, we may keep a mount point from being unmounted. Closes #1528
This commit is contained in:
parent
14472cdbd9
commit
66f25bb434
2 changed files with 13 additions and 0 deletions
|
|
@ -61,8 +61,13 @@
|
||||||
* config: ARGB color values now default to opaque, rather than
|
* config: ARGB color values now default to opaque, rather than
|
||||||
transparent, when the alpha component has been left out
|
transparent, when the alpha component has been left out
|
||||||
([#1526][1526]).
|
([#1526][1526]).
|
||||||
|
* The `foot` process now changes CWD to `/` after spawning the shell
|
||||||
|
process. This ensures the terminal itself does not "lock" a
|
||||||
|
directory; for example, preventing a mount point from being
|
||||||
|
unmounted ([#1528][1528]).
|
||||||
|
|
||||||
[1526]: https://codeberg.org/dnkl/foot/issues/1526
|
[1526]: https://codeberg.org/dnkl/foot/issues/1526
|
||||||
|
[1528]: https://codeberg.org/dnkl/foot/issues/1528
|
||||||
|
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
|
||||||
8
slave.c
8
slave.c
|
|
@ -401,6 +401,14 @@ slave_spawn(int ptmx, int argc, const char *cwd, char *const *argv,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Don't stay in CWD, since it may be an ephemeral path. For
|
||||||
|
* example, it may be a mount point of, say, a thumb drive. Us
|
||||||
|
* keeping it open will prevent the user from unmounting it.
|
||||||
|
*/
|
||||||
|
chdir("/");
|
||||||
|
|
||||||
close(fork_pipe[1]); /* Close write end */
|
close(fork_pipe[1]); /* Close write end */
|
||||||
LOG_DBG("slave has PID %d", pid);
|
LOG_DBG("slave has PID %d", pid);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue