Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shell does not accept arguments #128

Open
inferiorhumanorgans opened this issue Apr 3, 2022 · 2 comments
Open

Shell does not accept arguments #128

inferiorhumanorgans opened this issue Apr 3, 2022 · 2 comments
Labels
Type: Bug Something isn't working

Comments

@inferiorhumanorgans
Copy link

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.

@sassman
Copy link
Owner

sassman commented Apr 3, 2022

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 sassman added the Type: Bug Something isn't working label Apr 3, 2022
@inferiorhumanorgans
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants