prompt-toolkit / python-prompt-toolkit

Library for building powerful interactive command line applications in Python
https://python-prompt-toolkit.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
9.11k stars 718 forks source link

termios.error: (5, 'Input/output error') on xonsh appimage with prompt_toolkit 3 #1123

Open anki-code opened 4 years ago

anki-code commented 4 years ago

Hello!

When I try to run xonsh.AppImage from bash I get the error termios.error: (5, 'Input/output error'). Could you please help to understand the cause?

5 minute way to create xonsh.AppImage and reproduce on linux:

mkdir -p /tmp/test && cd /tmp/test
git clone https://github.com/niess/python-appimage && cd python-appimage
echo -e "git+https://github.com/xonsh/xonsh\nprompt_toolkit\nPygments" > applications/xonsh/requirements.txt 
python -m python_appimage build app applications/xonsh

After it run from bash:

./xonsh-x86_64.AppImage --shell-type ptk3
@ echo 123

As result:

Stopped xonsh-x86_64.AppImage

 File "/tmp/.mount_xonsh-cjX0IA/opt/python3.8/lib/python3.8/site-packages/xonsh/main.py", line 405, in main
    return main_xonsh(args)
  File "/tmp/.mount_xonsh-cjX0IA/opt/python3.8/lib/python3.8/site-packages/xonsh/main.py", line 434, in main_xonsh
    shell.shell.cmdloop()
  File "/tmp/.mount_xonsh-cjX0IA/opt/python3.8/lib/python3.8/site-packages/xonsh/ptk_shell/shell.py", line 197, in cmdloop
    line = self.singleline(auto_suggest=auto_suggest)
  File "/tmp/.mount_xonsh-cjX0IA/opt/python3.8/lib/python3.8/site-packages/xonsh/ptk_shell/shell.py", line 166, in singleline
    line = self.prompter.prompt(**prompt_args)
  File "/tmp/.mount_xonsh-cjX0IA/opt/python3.8/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 "/tmp/.mount_xonsh-cjX0IA/opt/python3.8/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 811, in run
    return loop.run_until_complete(
  File "/tmp/.mount_xonsh-cjX0IA/opt/python3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/tmp/.mount_xonsh-cjX0IA/opt/python3.8/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 778, in run_async
    return await _run_async2()
  File "/tmp/.mount_xonsh-cjX0IA/opt/python3.8/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 760, in _run_async2
    result = await _run_async()
  File "/tmp/.mount_xonsh-cjX0IA/opt/python3.8/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 682, in _run_async
    with self.input.raw_mode():
  File "/tmp/.mount_xonsh-cjX0IA/opt/python3.8/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

Could you please help or give an advice how I can debug this and find the cause?

I noticed that this error appears when I run xonsh.AppImage from bash. If I install xonsh locally, run it and then run xonsh.AppImage from xonsh it works without errors.

Thanks!

jonathanslenders commented 4 years ago

I'm not familiar with AppImages. Could it be that they don't allocate a pseudo terminal, or a pseudo terminal with different properties somehow?

anki-code commented 4 years ago

Thank you for response! Is there a way to check it?

anki-code commented 6 months ago

hi @jonathanslenders! We have the second issue around this (link above). How we can debug this?