t-rec-rs icon indicating copy to clipboard operation
t-rec-rs copied to clipboard

Shell does not accept arguments

Open inferiorhumanorgans opened this issue 2 years ago • 2 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.

inferiorhumanorgans avatar Apr 03 '22 10:04 inferiorhumanorgans

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 avatar Apr 03 '22 10:04 sassman

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

inferiorhumanorgans avatar Apr 04 '22 00:04 inferiorhumanorgans