vi / websocat

Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
MIT License
6.73k stars 259 forks source link

Large paste on Mac #103

Closed georgefst closed 3 years ago

georgefst commented 3 years ago

Version 1.6.0

When trying to paste more than 1024 bytes in to websocat -s on MacOS Big Sur, something goes horribly wrong and I have to kill the process.

The first 1024 characters appear in the terminal, then I hear a few popping sounds and the terminal locks up.

vi commented 3 years ago

Is it related to #76?

Does working it around with websocat -tE ws-l:127.0.0.1:1234 broadcast:threadedstdio: instead of -s changes anything?

georgefst commented 3 years ago

Is it related to #76?

Very possibly - it does look similar.

Does working it around with websocat -tE ws-l:127.0.0.1:1234 broadcast:threadedstdio: instead of -s changes anything?

Unfortunately not. Is it worth trying to build from HEAD or is the only change just to make the default the same as passing those arguments?

vi commented 3 years ago

Is it worth trying to build from HEAD or is the only change just to make the default the same as passing those arguments?

It is probably the case.

Unfortunately not.

Does pasting it into, for example, /bin/cat work properly? What about pasting into websocat -b threadedstdio: mirror: or websocat -b stdio: mirror:? Which terminal emulator software do you use, does the problem stays the same with other emulator?

georgefst commented 3 years ago

Thanks for your time responding to this. Looks like it doesn't really have much to do with websocat...

Does pasting it into, for example, /bin/cat work properly? What about pasting into websocat -b threadedstdio: mirror: or websocat -b stdio: mirror:?

No x3.

Which terminal emulator software do you use, does the problem stays the same with other emulator?

Only tried the pre-installed terminal app so far.

Anyway, this seems to be a well-known issue, discussed e.g. here and here. What works is setting STTY=-icanon, as suggested in that second link.

vi commented 3 years ago

If it does not work with cat then it's probably not Websocat's business to deal with the problem.

Does the STTY workaround work for websocat?

Should using readline library help? Do other command-line programs for Mac typically handle such pastes (or automatically set STTY)? If so, rlwrap websocat -s ... can help as well (in addition to providing command history, line editing, etc.).

georgefst commented 3 years ago

I'm unsure about other programs since I'm very new to the Mac ecosystem. But anyway, the STTY workaround works, so I'm back to being a happy user.