GithubHelp home page GithubHelp logo

Comments (3)

Rahix avatar Rahix commented on July 17, 2024

Hi,

the error message gives a clue that there appear to be some unexpected escape sequences in the output:

invalid literal for int() with base 10: '2004l\rexit\necho $?\n'

The interesting part is the 2004l and that's an escape sequence related to bracketed paste mode. I really have no clue how this could be related to using a venv or not, but I did notice that I can produce a similar failure on my system when using the new pytest testsuite:

❯ python -m pytest selftest/ -k 'test_simple_output' -v
===================================== test session starts ======================================
platform linux -- Python 3.9.4, pytest-6.2.3, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python
cachedir: .pytest_cache
rootdir: /home/rahix/Documents/Development/tbot
plugins: hypothesis-6.10.1, mock-3.1.1, qt-3.3.0
collected 138 items / 134 deselected / 4 selected                                              

selftest/tests/test_shell.py::test_simple_output[LocalhostBash] PASSED                   [ 25%]
selftest/tests/test_shell.py::test_simple_output[LocalhostSlowBash] PASSED               [ 50%]
selftest/tests/test_shell.py::test_simple_output[LocalhostAsh] FAILED                    [ 75%]
selftest/tests/test_shell.py::test_simple_output[MocksshClient] PASSED                   [100%]

=========================================== FAILURES ===========================================
_______________________________ test_simple_output[LocalhostAsh] _______________________________

[...]
    
>       return (int(retcode), out)
E       ValueError: invalid literal for int() with base 10: '\x1b[?2004l\r0\n\x1b[?2004h'

It is clearly visible here that the other end disabled bracketed paste mode after entering a command and reenabled it before returing to the prompt. So this smells a lot like GNU readline and indeed the changelog for readline version 8.1 notes that

h. Bracketed paste mode is enabled by default. There is a configure-time option (--enable-bracketed-paste-default) to set the default to on or off.

Now, this leaves me wondering why it even works at all with bash right now, but apparently LocalhostBash works fine and just LocalhostAsh (which uses bash --posix under the hood) does not. I need to take a closer look to find out what's going on here... In the meantime, can you verify that you have GNU readline version 8.1 installed?

from tbot.

Rahix avatar Rahix commented on July 17, 2024

Okay, I found a solution that at least solves the problems I could see. Please try again with the latest version from master (ec0f6c6 ("treewide: Invoke bash with --noediting")) whether the problem is fixed for you as well.

from tbot.

NoUmlautsAllowed avatar NoUmlautsAllowed commented on July 17, 2024

Hi,

thanks for the quick response.

Yes, I can confirm that I have GNU readline 8.1 installed. The changes in ec0f6c6 fix the problem for me as well.

Thanks.

from tbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.