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

No-decoration mode #35

Open
colinleroy opened this issue Sep 3, 2023 · 8 comments
Open

No-decoration mode #35

colinleroy opened this issue Sep 3, 2023 · 8 comments

Comments

@colinleroy
Copy link

Hi,
Thanks for making this live :)
This does need a fullscreen, no-decoration mode though, for old monochrome terminals that don't like UTF-8 and color codes.

@gabe565
Copy link
Owner

gabe565 commented Sep 5, 2023

Hey! Thanks for opening this. I was pretty sure that the tool I used would detect supported terminal colors. It definitely supports detection of true color vs 256.
I'd like to reproduce but my terminals are too fancy...I'll do some testing.

@colinleroy
Copy link
Author

colinleroy commented Sep 5, 2023

To be more precise, there's no TERM set, it's over telnet. You would have to implement (a subset of) https://www.rfc-editor.org/rfc/rfc1091.html (see also https://www.omnisecu.com/tcpip/telnet-negotiation.php)
basically you have to send
IAC DO TERMINAL-TYPE

hope to receive
IAC WILL TERMINAL-TYPE

In which case you can open subnegotiation and send
IAC SB TERMINAL-TYPE SEND IAC SE

and the client will reply
IAC SB TERMINAL_TYPE IS VT100 IAC SBE

as octal strings, this looks like:
IAC DO TERMINAL-TYPE = "\377\373\30"
IAC WILL TERMINAL-TYPE = "\377\373\30"
etc.
You can find the list of codes at https://www.ibm.com/docs/en/zos/2.1.0?topic=problems-telnet-commands-options

You can also negotiate the window size with the same system, basically.
(Or, you could be lazy and assume VT100, 80x24 over telnet, but that wouldn't be fun, would it? :)

(I'd love to have opened a PR but I do suck at Go and I'm already in another rabbit hole at the moment, learning 6502 assembly 😆)

@colinleroy
Copy link
Author

If you want tests, I do have a vt100 implementation working well enough to handle vim and mc on my Apple II, so it should do the right thing :)

@gabe565
Copy link
Owner

gabe565 commented Sep 5, 2023

Oh ok that makes total sense. Terminal detection works pretty well locally or over SSH, but I wrote the Telnet implementation from scratch, so it's not perfect yet. It already performs some detection so Telnet escape codes don't get sent if someone uses something like nc instead of the actual telnet command, so I'll see if I can hook into that. I'll let you know when I have something ready to test!

Also, completely off topic, but I recently tried my hand at writing an NES emulator in Go and was exposed to 6502 assembly more than I had been in the past...that seems like a pretty tough rabbit hole 😂

@gabe565 gabe565 reopened this Nov 24, 2023
@gabe565
Copy link
Owner

gabe565 commented Nov 24, 2023

@colinleroy Non-color terms are now supported! When a device connects, ascii-movie attempts to grab the current TERM, and depending on the value it will choose ANSI256, ANSI, or ASCII colors. This works for both telnet and SSH. If it is unable to fetch the current TERM, it will default to ANSI.

The overall look has some tweaks so the buttons still make sense. Here's what non-color mode looks like:
image

Would you mind testing on your old terminal? There may still be some UTF-8 characters I need to remove, but we'll see.

@colinleroy
Copy link
Author

Hi Gabe! Thanks! I'll test that as soon as possible, should be in a few days 🙂

@colinleroy
Copy link
Author

colinleroy commented Dec 1, 2023

Hi Gabe! I've tested and it gives this :) https://www.colino.net/tmp/vt100.mp4
I think it will really need a no-decoration mode for vt100. Maybe I should implement this to inform the server of the window size (80x24 in my case) :https://datatracker.ietf.org/doc/html/rfc1073#section-2

@gabe565
Copy link
Owner

gabe565 commented Dec 31, 2023

@colinleroy I love the video, but that's not as nice as I had hoped...I'll have to look at the vt100 spec some more!

gabe565 added a commit that referenced this issue Apr 19, 2024
gabe565 added a commit that referenced this issue Apr 19, 2024
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

2 participants