aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/input/command.rs
diff options
context:
space:
mode:
authorspacemaison <tuchsen@protonmail.com>2021-09-10 08:35:06 -0700
committerGitHub <noreply@github.com>2021-09-10 17:35:06 +0200
commit4f94f95c90a0b5c2cb3992533cec40cc55f05983 (patch)
tree006824300f43717d08862eeb8ebb08c151dd62c4 /zellij-utils/src/input/command.rs
parentdocs(changelog): tab bar fixes (diff)
downloadsl0ppij-4f94f95c90a0b5c2cb3992533cec40cc55f05983.tar.gz
sl0ppij-4f94f95c90a0b5c2cb3992533cec40cc55f05983.tar.xz
sl0ppij-4f94f95c90a0b5c2cb3992533cec40cc55f05983.zip
feat(cwd-pane): Keeping the cwd when opening new panes (#691)
* feat(cwd-pane): Add a new trait to get the cwd of a given pid Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Allow for setting the cwd when spawning a new terminal Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Add an active_pane field to the Pty struct Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Update Pty with Tab's active pane id Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Refactor spawn_terminal to use cwd by default Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Fix tests and lints Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Fix formatting * feat(cwd-pane): Refactor child pid fetching to handle errors better Instead of panicking when transfering the process id of the forked child command we just return an empty process id. * feat(cwd-pane): Add non Linux/MacOS targets for the get_cwd method. This will allow Zellij to compile on non Linux/MacOS targets without having an inherited cwd. * feat(cwd-pane): Refactor spawn_terminal method to use ChildId struct. The spawn_terminal methods been refactored to use the ChildId struct in order to clarify what the Pid's returned by it are. The documentation for the ChildId struct was improved as well. * feat(cwd-pane): Fix tests/lints Co-authored-by: Jesse Tuchsen <not@disclosing> Co-authored-by: Quentin Rasmont <qrasmont@gmail.com>
Diffstat (limited to 'zellij-utils/src/input/command.rs')
-rw-r--r--zellij-utils/src/input/command.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/zellij-utils/src/input/command.rs b/zellij-utils/src/input/command.rs
index 2054f208..debd5bc5 100644
--- a/zellij-utils/src/input/command.rs
+++ b/zellij-utils/src/input/command.rs
@@ -15,6 +15,8 @@ pub struct RunCommand {
pub command: PathBuf,
#[serde(default)]
pub args: Vec<String>,
+ #[serde(default)]
+ pub cwd: Option<PathBuf>,
}
/// Intermediate representation
@@ -25,6 +27,8 @@ pub struct RunCommandAction {
#[serde(default)]
pub args: Vec<String>,
#[serde(default)]
+ pub cwd: Option<PathBuf>,
+ #[serde(default)]
pub direction: Option<Direction>,
}
@@ -33,6 +37,7 @@ impl From<RunCommandAction> for RunCommand {
RunCommand {
command: action.command,
args: action.args,
+ cwd: action.cwd,
}
}
}