anki-code / xontrib-pipeliner

Let your pipe lines flow thru the Python code in xonsh.
BSD 2-Clause "Simplified" License
56 stars 5 forks source link

Does not work with bashisms loaded #1

Closed rajaravivarma-r closed 3 years ago

rajaravivarma-r commented 4 years ago

Thanks for the useful snippet.

I tried this plugin with bashisms loaded but couldn't get it to work. When I do echo "hello world" | pl "line". It is stuck forever and doesn't print anything.

After removing bashishms from xontrib load, it is working as expected. I read the bashishms source code but couldn't figure out the conflicting piece of code.

anki-code commented 4 years ago

Thanks! It looks like https://github.com/xonsh/xonsh/issues/3525 https://github.com/xonsh/xonsh/issues/3555 again. fyi @gforsyth

$ echo 123 | pl "line + '123'"
123123
$ xontrib load bashisms
$ echo 123 | pl "line + '123'"
^C^C^C^C^C^C^C^C^C^C             

# after kill -9 the process:

Traceback (most recent call last):
  File "/opt/miniconda/lib/python3.8/site-packages/xonsh/main.py", line 405, in main
    return main_xonsh(args)
  File "/opt/miniconda/lib/python3.8/site-packages/xonsh/main.py", line 434, in main_xonsh
    shell.shell.cmdloop()
  File "/opt/miniconda/lib/python3.8/site-packages/xonsh/ptk_shell/shell.py", line 197, in cmdloop
    line = self.singleline(auto_suggest=auto_suggest)
  File "/opt/miniconda/lib/python3.8/site-packages/xonsh/ptk_shell/shell.py", line 166, in singleline
    line = self.prompter.prompt(**prompt_args)
  File "/opt/miniconda/lib/python3.8/site-packages/prompt_toolkit/shortcuts/prompt.py", line 994, in prompt
    return self.app.run(set_exception_handler=set_exception_handler)
  File "/opt/miniconda/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 811, in run
    return loop.run_until_complete(
  File "/opt/miniconda/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/opt/miniconda/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 778, in run_async
    return await _run_async2()
  File "/opt/miniconda/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 760, in _run_async2
    result = await _run_async()
  File "/opt/miniconda/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 682, in _run_async
    with self.input.raw_mode():
  File "/opt/miniconda/lib/python3.8/site-packages/prompt_toolkit/input/vt100.py", line 259, in __enter__
    termios.tcsetattr(self.fileno, termios.TCSANOW, newattr)
termios.error: (5, 'Input/output error')
Xonsh encountered an issue during launch
Failback to /bin/sh
anki-code commented 4 years ago

I've tested in xonsh 0.9.13 and it works:

$ xonsh -V
xonsh/0.9.13.dev1

$ echo 123 | pl "line + '123'"
123123

$ xontrib load bashisms

$ echo 123 | pl "line + '123'"
123123

It's definitely https://github.com/xonsh/xonsh/issues/3525 https://github.com/xonsh/xonsh/issues/3555

rajaravivarma-r commented 4 years ago

Thank you. I will close this issue as this looks like a problem with the upstream package.

anki-code commented 4 years ago

I reopen the issue to force fix https://github.com/xonsh/xonsh/pull/3342

anki-code commented 3 years ago

Closed with reference to https://github.com/xonsh/xonsh/issues/4250