diff options
| author | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-04-13 17:59:22 +0200 |
|---|---|---|
| committer | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-04-30 02:07:20 +0200 |
| commit | 62992295d67958683e97c4dbafeb3f5396bb6742 (patch) | |
| tree | 04e3d8ebca72561ca615ac9c106bf280754694a7 /doc | |
| parent | 85a7d902c039d82a646f771f661d6935f0a6a1cf (diff) | |
shell: Add --cwd.
* guix/scripts/environment.scm (show-environment-options-help): Document
--cwd.
(%options): Add cwd.
(launch-environment/container): Add cwd parameter. Implement passing it to
the container.
(guix-environment*): Reject --cwd without --container.
* doc/guix.texi (Invoking guix shell): Document it.
* tests/guix-environment-container.sh: Add tests.
* tests/guix-shell.sh: Add tests.
Fixes: guix/guix# 7825
Change-Id: Iba4ff3d2058e92f504fbcbf688346357ce913213
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/guix.texi | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index b2ff12dcb1..50eddc426e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6591,6 +6591,21 @@ directory within the container. If this is undesirable, be automatically shared and will change to the user's home directory within the container instead. See also @option{--user}. +@item --cwd=@var{directory} +For containers, change to @var{directory} inside the container instead +of the default location. The default location is the current working +directory when @option{--no-cwd} is not used, or the user's home +directory when @option{--no-cwd} is used. When @var{directory} is a +relative file name, it is interpreted relative to the current working +directory on the host. Note that @option{--cwd} does not automatically +share @var{directory}---you must ensure it is accessible via the default +current directory sharing or explicit @option{--share}/@option{--expose} +options. For example: + +@example +guix shell --container --cwd=/tmp --share=/tmp coreutils +@end example + @item --writable-root When using @option{--container}, this option makes the root file system writable (it is read-only by default). @@ -7092,6 +7107,17 @@ directory within the container. If this is undesirable, be automatically shared and will change to the user's home directory within the container instead. See also @option{--user}. +@item --cwd=@var{directory} +For containers, change to @var{directory} inside the container instead +of the default location. The default location is the current working +directory when @option{--no-cwd} is not used, or the user's home +directory when @option{--no-cwd} is used. When @var{directory} is a +relative file name, it is interpreted relative to the current working +directory on the host. Note that @option{--cwd} does not automatically +share @var{directory}---you must ensure it is accessible via the default +current directory sharing or explicit @option{--share}/@option{--expose} +options. + @item --expose=@var{source}[=@var{target}] @itemx --share=@var{source}[=@var{target}] For containers, @option{--expose} (resp. @option{--share}) exposes the |
