Git Product home page Git Product logo

Comments (4)

ekzhang avatar ekzhang commented on May 21, 2024

Thanks for the detailed bug report including version, browser, nushell and Rust versions. I'm not familiar with nu, and I'm surprised that it wouldn't be working. Not specifically as a shell, but as a terminal program, that's strange that it would behave differently on sshx.

It's possible it could be due to sshx not supporting various ANSI escape sequences for PTY queries like the "Query Cursor Position" sequence. This is because it can replay the output sequence multiple times across users. I'll try and see.

from sshx.

ekzhang avatar ekzhang commented on May 21, 2024

I am able to reproduce on macOS Ventura.

from sshx.

ekzhang avatar ekzhang commented on May 21, 2024

Ah, well my random hunch was right. Here's the strace output from Alpine Linux (repeats every few seconds, probably stuck in a retry loop internally in nushell):

Steps to reproduce

I'm running in an Alpine Linux, aarch64 container.

docker run -it --rm alpine:3.18.4

Then in Alpine:

apk add curl
apk add nushell --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
curl -sSf https://sshx.io/get | sh
sshx

Inside sshx, open multiple terminals and in one terminal:

echo $$

To get the PID, then run in the second terminal:

strace -f -p $PID

And in the first terminal:

nu

[pid    76] ioctl(0, TIOCGWINSZ, {ws_row=24, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0
[pid    76] ioctl(0, TCGETS, {c_iflag=ICRNL|IXON, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
[pid    76] ioctl(0, TCSETS, {c_iflag=, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ECHOE|ECHOK|ECHOCTL|ECHOKE, ...}) = 0
[pid    76] openat(AT_FDCWD, "/dev/tty", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 8
[pid    76] fcntl(8, F_SETFD, FD_CLOEXEC) = 0
[pid    76] ioctl(8, TIOCGWINSZ, {ws_row=24, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0
[pid    76] close(8)                    = 0
[pid    76] write(1, "\33[6n", 4)       = 4
[pid    76] epoll_pwait(5, 

\33[6n is the "Device Status Report" (DSR) escape sequence, which requests the cursor position from the terminal. I don't see an immediate way to support this in sshx right now, unfortunately (especially since it's end-to-end encrypted, so the server certainly can't handle it) but maybe we can add something to the client binary that outputs a fake cursor position.

Is there any possibility that the nushell authors would be able to add a fallback for terminals that don't support cursor position reporting?

from sshx.

Slushee-a avatar Slushee-a commented on May 21, 2024

Is there any possibility that the nushell authors would be able to add a fallback for terminals that don't support cursor position reporting?

It seems like it was a low priority issue last year, but it might be implemented as of now.
I can fork sshx tomorrow and attempt to implement the least dodgy workaround possible. If I don't succeed, shall I close this isse?

from sshx.

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.