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

Pipe inside string break pipe #606

Closed
2 tasks done
jcubic opened this issue Jul 24, 2020 · 1 comment
Closed
2 tasks done

Pipe inside string break pipe #606

jcubic opened this issue Jul 24, 2020 · 1 comment
Labels
Bug resolved if issue is resolved, it will be open until merge with master

Comments

@jcubic
Copy link
Owner

jcubic commented Jul 24, 2020

Issue summary

If you use pipe instead string and pipe it to another command, the commands is split wrongly.

Expected behavior

I expect to be able to use pipe operator in string

Actual behavior

The string is split into two commands.

Steps to reproduce

  1. Open Pipe Demo
  2. Type `echo "hello | world" | figlet"
  3. error wrong command is displayed

Interpreter is executed 3 times with:

  • "echo hello"
  • "world "
  • "figlet "

TODO

  • Fix the bug
  • Write unit tests
@jcubic jcubic added the Bug label Jul 24, 2020
jcubic added a commit that referenced this issue Jul 24, 2020
Fix stringify commands in function interpreter inside pipe
The problem was that function interpreter or pipe option use exec and restore original commands after split
And it didn't included the quotes so pipe inside string was not inside string when executed the command
@jcubic
Copy link
Owner Author

jcubic commented Jul 24, 2020

The issue was with pipe: option that behind the scene used function interpreter created from commands.
The code was calling stringify function that converted parsed command into single command for exec and it didn't use quotes.
The code was tested using old API without monkey patch $.terminal.pipe({ }) that was working fine.

jcubic added a commit that referenced this issue Aug 1, 2020
@jcubic jcubic added resolved if issue is resolved, it will be open until merge with master and removed in progress labels Aug 1, 2020
@jcubic jcubic closed this as completed Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug resolved if issue is resolved, it will be open until merge with master
Projects
None yet
Development

No branches or pull requests

1 participant