renamed 'root' command to 'path'

This commit is contained in:
Valerie Wolfe 2024-06-10 12:03:40 -04:00
parent 1320b6f122
commit 0fc6cd66c6
4 changed files with 14 additions and 10 deletions

View file

@ -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`
```

View file

@ -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()

View file

@ -23,6 +23,9 @@ commands:
list Pretty-print all tmux sessions
new Create a new tmux session
path print session path (session)
switch switch to another session (session)
Use 'remux help <command>' to see detailed help text for each command.
help topics:
@ -100,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")
=>

View file

@ -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),