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

Support for large terminal windows with a tiny font #3980

Closed
mc-butler opened this issue Apr 24, 2019 · 10 comments
Closed

Support for large terminal windows with a tiny font #3980

mc-butler opened this issue Apr 24, 2019 · 10 comments
Labels
area: tty Interaction with the terminal, screen libraries prio: medium Has the potential to affect progress res: invalid The ticket is not a bug, or is a support request ver: 4.8.22 Reproducible in version 4.8.22

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/3980
Reporter 0xe2.0x9a.0x9b (0xe2.0x9a.0x9b@….com)
Mentions 0xe2.0x9a.0x9b@….com

Hello.

The Kitty terminal emulator enables the user to quickly change the font size. With a very tiny font, the number of columns in the terminal is very large and seems to overflow an internal Midnight Commander limit.

Steps to reproduce:

  1. Open a new Kitty terminal window
  2. Maximize the Kitty window
  3. Start Midnight commander in Kitty
  4. Press Ctrl+Shift+- multiple times until reaching the minimum font size

Executing "tput cols" can be used to get the number of columns in the terminal.

columns=384: correct rendering

columns=480: incorrect rendering (missing vertical bars, tput reports 480 columns from mc's command-line ---- this seems to be a Kitty bug)

columns=640: incorrect rendering (mc is on the left side of the screen, tput reports 80 columns from mc's command-line)


Xfce4-Terminal with fontsize=1 and 1906 columns: mc is on the left side of the screen, tput reports 80 columns from mc's command-line.


This is a bit academic/theoretical only, because the tiny font is unreadable on a 1920x1080 monitor. But with 4K/8K displays the font might be readable.

Note

Original attachments:

  • 640-columns.png (raw) by 0xe2.0x9a.0x9b (0xe2.0x9a.0x9b@….com) on Apr 24, 2019 at 22:31 UTC
@mc-butler
Copy link
Author

Changed by 0xe2.0x9a.0x9b (0xe2.0x9a.0x9b@….com) on Apr 24, 2019 at 22:31 UTC

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Apr 25, 2019 at 5:55 UTC

Replying to 0xe2.0x9a.0x9b (#3980):

the number of columns in the terminal is very large and seems to overflow an internal Midnight Commander limit.

mc gets the terminal size from screen library or from ioctl(TIOCGWINSZ).

columns=480: incorrect rendering (missing vertical bars, tput reports 480 columns from mc's command-line ---- this seems to be a Kitty bug)

columns=640: incorrect rendering (mc is on the left side of the screen, tput reports 80 columns from mc's command-line)

The threshold is 512.

Resize to 512 columns:

$ echo $COLUMNS
512

Correct rendering.

Resize to 513 columns:

$ echo $COLUMNS
80

Incorrect rendering regardless of resizing terminal window with running mc or run mc in the preliminary resized window.

MATE terminal 1.12.1, xterm-320.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Apr 25, 2019 at 6:36 UTC (comment 2)

This is S-Lang limitation:

     96 # define SLTT_MAX_SCREEN_COLS 512
     97 # define SLTT_MAX_SCREEN_ROWS 512
   3310    if ((r <= 0) || (r > SLTT_MAX_SCREEN_ROWS)) r = 24;
   3311    if ((c <= 0) || (c > SLTT_MAX_SCREEN_COLS)) c = 80;
   3312    SLtt_Screen_Rows = r;
   3313    SLtt_Screen_Cols = c;

@mc-butler
Copy link
Author

Changed by 0xe2.0x9a.0x9b (0xe2.0x9a.0x9b@….com) on Apr 25, 2019 at 11:16 UTC (comment 2.3)

Replying to andrew_b:

This is S-Lang limitation

You are right. In Gentoo Linux, rebuilding mc without slang resolves the issue.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Apr 25, 2019 at 17:32 UTC (comment 4)

  • Type changed from enhancement to defect
  • Component changed from mc-core to mc-tty
  • Status changed from new to closed
  • Milestone Future Releases deleted
  • Resolution set to invalid

@mc-butler
Copy link
Author

Changed by 0xe2.0x9a.0x9b (0xe2.0x9a.0x9b@….com) on Apr 25, 2019 at 18:04 UTC (comment 5)

Hello. I don't understand why the ticket has been resolved as "invalid". Isn't it true that Midnight Commander could *by itself* on-the-fly switch to using ncurses rather than slang when it determines that the number of columns or rows exceeds 512, even if it is compiled with slang support?

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Apr 26, 2019 at 5:37 UTC (comment 5.6)

Replying to 0xe2.0x9a.0x9b:

I don't understand why the ticket has been resolved as "invalid".

Because this is not a bug. This is neither MC nor S-Lang bug. This is well (or not well) known limitation of S-Lang. If you think this is a bug, please send bug report to S-Lang author.

Isn't it true that Midnight Commander could *by itself* on-the-fly switch to using ncurses

No, it isn't.

Btw, duplicate of #1498.

@mc-butler
Copy link
Author

Changed by 0xe2.0x9a.0x9b (0xe2.0x9a.0x9b@….com) on Apr 26, 2019 at 13:23 UTC (comment 6.7)

Replying to andrew_b:

Replying to 0xe2.0x9a.0x9b:

I don't understand why the ticket has been resolved as "invalid".

Because this is not a bug. This is neither MC nor S-Lang bug. This is well (or not well) known limitation of S-Lang. If you think this is a bug, please send bug report to S-Lang author.

 
Already done that: http://lists.jedsoft.org/lists/slang-devel/2019/0000000.html
 

Isn't it true that Midnight Commander could *by itself* on-the-fly switch to using ncurses

No, it isn't.

 
I am not convinced about the truthfulness of your claim yet. Wouldn't it be possible for a future MC at least in theory, at some point during runtime, to transparently switch from using slang functions to ncurses functions when it detects that the terminal has been resized to >= 512 columns, and to switch back to using slang when the terminal is resized to < 512 columns?

Note that this is a theoretical question. I am not forcing MC to actually implement the slang⟷curses runtime switching.
 

Btw, duplicate of #1498.

 
Thanks.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Apr 27, 2019 at 16:20 UTC (comment 7.8)

Replying to 0xe2.0x9a.0x9b:

Already done that: http://lists.jedsoft.org/lists/slang-devel/2019/0000000.html

Thanks.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Apr 25, 2020 at 4:31 UTC (comment 9)

hankem/S-Lang@55f5879

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tty Interaction with the terminal, screen libraries prio: medium Has the potential to affect progress res: invalid The ticket is not a bug, or is a support request ver: 4.8.22 Reproducible in version 4.8.22
Development

No branches or pull requests

1 participant