mirror of
https://github.com/TECHNOFAB11/tmux-copyrat.git
synced 2025-12-16 01:43:51 +01:00
fix: tmux options read correctly
This commit is contained in:
parent
7ce0e95c8c
commit
ae19f2b4e4
3 changed files with 11 additions and 19 deletions
|
|
@ -141,10 +141,10 @@ pub fn list_panes() -> Result<Vec<Pane>, ParseError> {
|
|||
/// # Example
|
||||
/// ```get_options("@copyrat-")```
|
||||
pub fn get_options(prefix: &str) -> Result<HashMap<String, String>, ParseError> {
|
||||
let output = duct::cmd!("tmux", "show", "-g").read()?;
|
||||
let output = duct::cmd!("tmux", "show-options", "-g").read()?;
|
||||
let lines: Vec<&str> = output.split('\n').collect();
|
||||
|
||||
let pattern = format!(r#"{prefix}([\w\-0-9]+) "?(\w+)"?"#, prefix = prefix);
|
||||
let pattern = format!(r#"({prefix}[\w\-0-9]+) "?(\w+)"?"#, prefix = prefix);
|
||||
let re = Regex::new(&pattern).unwrap();
|
||||
|
||||
let args: HashMap<String, String> = lines
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue