Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with newlines #443

Open
TheGeekOnSkates opened this issue Oct 17, 2023 · 0 comments
Open

Issues with newlines #443

TheGeekOnSkates opened this issue Oct 17, 2023 · 0 comments

Comments

@TheGeekOnSkates
Copy link

Hey there,

This is probably not near as important as some of your other issues, low priority to be sure, but I have a couple questions regarding new-line characters:

  1. First off, if you go to my test site running Mobile Mainframe (a terminal-in-a-browser utility I built), I've run into a kind of strange problem: If you go to http://104.200.17.247/apps/mm/ and type (or paste with Shift-CTRL-V) this URL: ws://104.200.17.247:12345 you'll get a little game I built. Now this game used to use fgets, but the modded version I posted here was recompiled with GNU Readline. But in either case, the problem is this: it seems websocketd is stuck in "line mode" - that is, it sends a newline after every character I type (so "n" works as expected, but if I type the full word "north" that gets interpreted as 5 separate commands. I'm running websocketd with --binary, but that doesn't do what I thought it would. I'm looking for a way to tell websocketd, "don't append a newline on every char I send" - if there is even such a possibility. This tool I've built is capable of running vim, bastet, roguelikes etc. that don't expect a newline. How would I use websocketd to do something like that? No biggy if not possible, but it would sure be cool if so! 🆒

  2. I also noticed that if I use a command-line tool for an actual terminal - like websocat, for example - it doesn't do newlines at all. For example, if I run websocat ws://104.200.17.247:12345 I get the main menu of my game all on one line. The same is true of pretty much any other command-line app I pass to websocketd. Why doesn't websocketd send newlines? In the case of websocat, there's an easy fix: they have a --binary option too (so websocat --binary ws://104.200.17.247:12345 works great).

I have a feeling this is all just a huge misunderstanding on my part... I hope this issue made sense. Anyway, websocketd is awesome and thanks for taking the time to answer my noobish questions. 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant