Compare commits
No commits in common. "e00c9e5366eafba06ada0019494722ed39dd4d66" and "80a5c0a968e2aa40577340d5cc3fcb7870af7ef2" have entirely different histories.
e00c9e5366
...
80a5c0a968
2 changed files with 13 additions and 25 deletions
|
@ -14,7 +14,7 @@ path = "src/main.rs"
|
|||
|
||||
[dependencies]
|
||||
pico-args = { version = "0.5.0", features = [ "combined-flags", "eq-separator" ] }
|
||||
termion = "3.0.0"
|
||||
termion = "2.0.1"
|
||||
tmux_interface = "0.3.2"
|
||||
|
||||
[profile.release]
|
||||
|
|
|
@ -131,7 +131,7 @@ pub fn list() {
|
|||
// pretty print session list
|
||||
println!("sessions:");
|
||||
for session in sessions.into_iter() {
|
||||
let group = session.name.unwrap_or("[untitled]".to_string());
|
||||
let group = session.group.unwrap_or("[untitled]".to_string());
|
||||
let id = session.id.unwrap();
|
||||
let attached = session.attached.unwrap_or(0) > 0;
|
||||
|
||||
|
@ -173,16 +173,13 @@ pub fn new(pargs: &mut Arguments) {
|
|||
command = args.get(1);
|
||||
}
|
||||
|
||||
let mut tmux = Tmux::new();
|
||||
|
||||
// if no session exists with the given title, create one
|
||||
if !util::session_exists(&title) {
|
||||
let mut new = commands::NewSession::new();
|
||||
new = new.session_name(title);
|
||||
new = new.group_name(title);
|
||||
if let Some(command) = command { new.shell_command = Some(command.to_string_lossy()); }
|
||||
if detached { new.detached = true; }
|
||||
if let Ok(target_dir) = target_dir { new = new.start_directory(target_dir); }
|
||||
tmux = tmux.add_command(new).disable_echo();
|
||||
|
||||
let mut tmux = Tmux::new().add_command(new);
|
||||
|
||||
// rename window if var not empty
|
||||
if !window_name.is_empty() {
|
||||
|
@ -190,15 +187,6 @@ pub fn new(pargs: &mut Arguments) {
|
|||
.new_name(window_name);
|
||||
tmux = tmux.add_command(auto_name);
|
||||
}
|
||||
}
|
||||
// otherwise, use the existing session
|
||||
else {
|
||||
let mut attach = commands::AttachSession::new();
|
||||
attach = attach.target_session(title);
|
||||
tmux = tmux.add_command(attach);
|
||||
}
|
||||
|
||||
|
||||
|
||||
tmux.output().ok();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue