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

Broken layout when running tmux session selector #202

Closed
char101 opened this issue Sep 24, 2021 · 7 comments
Closed

Broken layout when running tmux session selector #202

char101 opened this issue Sep 24, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@char101
Copy link

char101 commented Sep 24, 2021

How to reproduce:

  1. run tmux, create two or more sessions
  2. type s
  3. move between sessions by using arrow up/down

Expected output:

  1. arrow up/down moves selection between session while the lower pane gives overview of the session windows

Actual output:

The terminal layout is broken.

@kingToolbox
Copy link
Owner

Sorry for the late reply. I just finished a long trip, and because there is no Internet, I can't deal with the issue in time.

I tried following your steps and everything is OK. Is it convenient for you to take a screenshot to see what the broken layout looks like? Thank you.

@char101
Copy link
Author

char101 commented Sep 27, 2021

Thanks for the response.

Here are the comparison screenshots for the following sequence of commands

$ tmux
in tmux:
<C-b>:new-session -s test
<C-b>:new-session -s test2
<C-b>s

I have changed the Color Theme font to M+ 1m.

How it should look like
right

How it look in windterm
windterm

@char101
Copy link
Author

char101 commented Sep 27, 2021

So I changed the color scheme to another color scheme which uses the original font, and the result is correct. So I guess this is caused by the (mis?)calculation of the font width?

@char101
Copy link
Author

char101 commented Sep 27, 2021

This is the link to the font: Mplus Code Latin 50 https://mplusfonts.github.io/ . The font is definitely fixed width, so maybe the font width calculation can be made more robust?

@kingToolbox
Copy link
Owner

Thank you for the detailed description. I have reproduced this issue, although mine screen does not look as bad as in your screenshot. I will try to fix this problem in the next prerelease version. Please stay tuned, thank you.

@kingToolbox kingToolbox self-assigned this Sep 28, 2021
@kingToolbox kingToolbox added the bug Something isn't working label Sep 28, 2021
@kingToolbox
Copy link
Owner

Hello, I just released the new version WindTerm_2.2.0_Prerelease_2 and fixed this issue, please download and check it, thank you.

The reason for this problem is not the wrong calculation of the font width. Instead, fonts are configured in multiple places in the theme:

{
	"name": "terminal.text",
	"style": {
		"fontFamily": "Roboto Mono, Fira Code Retina, Lucida Sans Typewriter, Lucida Console, Monoca"
	}
},
{
	"name": "text.default",
	"style": {
		"foreground": "#F8F8F2",
		"background": "#1c1c1c",
		"fontFamily": "Roboto Mono, Fira Code Retina, Lucida Sans Typewriter, Lucida Console, Monoca",
		"fontSize": 10
	}
},

So when you modify the font of the style text.default, part of the text is still drawn using the font of the style terminal.text , which leads to confusion in the layout. Since terminal.text, terminal.text.1 and terminal.text.2 were added many years ago, I even forgot about them. These styles are intended to support WindEdit and WindTerm to support different font settings, but obviously this design adds unnecessary complexity. I have removed terminal.text, terminal.text.1 and terminal.text.2 in the new version and everything is fine now.

In addition, you no longer need to manually modify the configuration file to modify the font. 😄 In the new version, a setting dialog box has been added. The fonts can be specified using Menubar - Session - Preferences - Settings - Text - Font - Default Font. I hope this will make it more convenient for you. Thank you.

@kingToolbox
Copy link
Owner

This issue has been solved and will be closed. Welcome to continue submitting new feature requests and bugs, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants