sassman / t-rec-rs

Blazingly fast terminal recorder that generates animated gif images for the web written in rust

Home Page:https://crates.io/crates/t-rec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shell does not accept arguments

inferiorhumanorgans opened this issue · comments

Arguments on the command line are not passed to the shell executed by t-rec. e.g.

t-rec /usr/local/bin/bash -l
This doesn't run, clap tries to gobble up -l.

t-rec -- /usr/local/bin/bash -l
This runs but -l is not passed to bash.

t-rec -- "/usr/local/bin/bash -l"
This starts, prints a "press ctrl-d to stop recording message", quits, and immediately resets the terminal. As a result you may see the recording message but you won't see the error message.

Thanks for reporting this.

As it seems there are 2 problems here:

  1. the message Press Ctrl+D to end recording appears, even if in that case the thread launching the shell dies.
  2. when calling t-rec '/bin/bash -l' the argument /bin/bash -l is used to start the shell, but somehow -l is considered to be part of the program to start.

@sassman Actually, the third is that extra arguments are not passed to the command (per the second variant above). Without looking at the code my guess is that you're taking the first positional arg not all of them.

IMO it's probably not worth splitting up a single string as an argument since that means getting into the shell parsing business.