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

Add support for client resizing window width after initial connect #3484

Closed
MorquinDevlar opened this issue Apr 3, 2024 · 4 comments
Closed
Labels
feature-request A suggestion for new functionality.

Comments

@MorquinDevlar
Copy link

MorquinDevlar commented Apr 3, 2024

Describe the bug

When setting client-screen-width to 80 chars, many commands like "help" or "examine" will not respect this and will display output wider than the char limit set by the client.

Using Mudlet and setting the char-width first to 100 and then to 80, gives me this display:

Screenshot 2024-04-03 at 22 46 44

To Reproduce

Steps to reproduce the behavior:
Set client width to less than 86 chars, and type "help" or "examine"

Expected behavior

I would expect the commands to respect client char width, and not display borders or even text that is too wide for the display.

Environment, Evennia version, OS etc

Mudlet, on OSX

@MorquinDevlar MorquinDevlar added bug An actual error or unwanted behavior. needs-triage Yet to be looked at and verified as an a real issue/feature that could be worked on labels Apr 3, 2024
@jaborsh
Copy link
Contributor

jaborsh commented Apr 7, 2024

Tried to reproduce. Set Mudlet length to 80 and length for both CmdExamine and CmdHelp was consistent with expectations. I reproduced your error by manually using options/save screenwidth = 100.

We could make an upgrade by having a client-side width adjustment automatically update the character options, but I believe you're seeing the error because of your character's screenwidth option and not because of a bug.

@MorquinDevlar
Copy link
Author

MorquinDevlar commented Apr 7, 2024

Thanks for value inputs @jaborsh

I did some further investigations:

I believe the issue is that the client width is only read once, on login. When you change it in the client and not using the options command in game, the value is not updated, unless you reconnect to the game.

  1. You are right in that setting the client width in options, produces the result I was expecting.
  2. Setting the client width, in client, and then reconnecting will also set the screen width values correctly.
  3. The default value in settings is apparently only used if the client does not set anything.

The question is - which settings should have priority?

When setting the client width in client and connecting the game is then set to the client width. If we then change the client width while still connected, the game ignores it, unless we reconnect again. This, to me, seems like faulty behaviour. Either we always use the client width, or never. Having it used only on connect seems to be half a solution.

Either we ignore the client and set the values in game, or we respect the client every time.

A compromise would be to have the command setting the width, read the client width and then warn the player if the game-command is setting the width to something wider than the client is allowing, thus forcing ugly linebreaks.

@Griatch
Copy link
Member

Griatch commented Apr 7, 2024

Thanks for the help reproducing and further discussion, @jaborsh and @MorquinDevlar!

We use the NAWS telnet option (RFC1073) for the client to report its screenwidth. We do this on client-connect and one can argue that we should listen for later changes here too (NAWS specs do suggest that one can also react to client size changes during an existing connection). This has rarely been an issue because most people don't resize their clients that often while running. But I agree it'd be a nice addition. I'd rate this as a feature rather than a bug though - it extends the existing functionality.

For priority though - the option you set in-game must take precedence over what the client sends. The reason for this is that some MUD clients or terminals don't reliably report their widths over NAWS. It's just the reality of people sticking to old third-party clients or non-compliant terminals. Without the ability to hand-set their widths, they would not be able to use those clients at all.

@Griatch Griatch changed the title A lot of built-in commands has issues with correct screen-width Add support for client resizing window width after initial connect Apr 7, 2024
@Griatch Griatch added feature-request A suggestion for new functionality. and removed bug An actual error or unwanted behavior. needs-triage Yet to be looked at and verified as an a real issue/feature that could be worked on labels Apr 7, 2024
@MorquinDevlar
Copy link
Author

Makes sense to me.

The only reason I actually looked into it, was that the old codebase I am upgrading defaulted to 80 chars, and all our rooms are meticulously built to look nice at 80 chars. When they are now stretched to 100 (or whatever is default on char creation) - it looked off.

I didn't know about the options command to set screen width, and I'll probably just set it to 80 chars by default for all players, and then let the ones who really want it, make the modification themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A suggestion for new functionality.
Projects
None yet
Development

No branches or pull requests

3 participants