diff --git a/README.md b/README.md index 2d8cd2a..a96eb7a 100644 --- a/README.md +++ b/README.md @@ -48,9 +48,9 @@ tmux swi -t foo rmux s foo # cd to session path -tmux run 'printf "#{session_path}" > /tmp/tmux_root' -cd `cat /tmp/tmux_root` -cd `rmux root` +tmux run 'printf "#{session_path}" > /tmp/tmux_path' +cd `cat /tmp/tmux_path` +cd `rmux p` ``` diff --git a/src/command/session.rs b/src/command/session.rs index 3bd3584..ca33fa5 100644 --- a/src/command/session.rs +++ b/src/command/session.rs @@ -9,7 +9,7 @@ use tmux_interface::{ use crate::{ error, flag, util }; -const TMP_ROOT: &str = "/tmp/remux_root"; +const TMP_ROOT: &str = "/tmp/remux_path"; pub fn switch(pargs: &mut Arguments) { util::terminal_enforce(); @@ -36,8 +36,8 @@ pub fn switch(pargs: &mut Arguments) { .output().ok(); } -pub fn root() { - util::session_enforce("root"); +pub fn path() { + util::session_enforce("path"); let exec = commands::Run::new().shell_command("printf '#{session_path}' > ".to_string() + TMP_ROOT); Tmux::new() diff --git a/src/help.rs b/src/help.rs index dece562..1de632e 100644 --- a/src/help.rs +++ b/src/help.rs @@ -23,7 +23,7 @@ commands: list Pretty-print all tmux sessions new Create a new tmux session - root print session path (session) + path print session path (session) switch switch to another session (session) Use 'remux help ' to see detailed help text for each command. @@ -103,11 +103,12 @@ flags: Some("root") => -println!("remux root +println!("remux path Print the session path (#{{session_path}}) to standard output. Must be run from inside a session. -usage: remux root"), +usage: remux path + remux p"), Some("s" | "switch") => diff --git a/src/main.rs b/src/main.rs index bb72006..e94a42e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,8 +60,8 @@ fn main() { Some("n" | "new") => command::share::new(&mut args), - Some("root") - => command::session::root(), + Some("p" | "path") + => command::session::path(), Some("s" | "switch") => command::session::switch(&mut args),