Ticket #3980 (closed defect: invalid)
Support for large terminal windows with a tiny font
Reported by: | 0xe2.0x9a.0x9b | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | mc-tty | Version: | 4.8.22 |
Keywords: | Cc: | 0xe2.0x9a.0x9b@… | |
Blocked By: | Blocking: | ||
Branch state: | no branch | Votes for changeset: |
Description
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:
- Open a new Kitty terminal window
- Maximize the Kitty window
- Start Midnight commander in Kitty
- 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.
Attachments
Change History
comment:1 in reply to: ↑ description Changed 6 years ago by andrew_b
Replying to 0xe2.0x9a.0x9b:
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.
comment:2 follow-up: ↓ 3 Changed 6 years ago by andrew_b
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;
comment:3 in reply to: ↑ 2 Changed 6 years ago by 0xe2.0x9a.0x9b
Replying to andrew_b:
This is S-Lang limitation
You are right. In Gentoo Linux, rebuilding mc without slang resolves the issue.
comment:4 Changed 6 years ago by andrew_b
- Status changed from new to closed
- Component changed from mc-core to mc-tty
- Type changed from enhancement to defect
- Resolution set to invalid
- Milestone Future Releases deleted
comment:5 follow-up: ↓ 6 Changed 6 years ago by 0xe2.0x9a.0x9b
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?
comment:6 in reply to: ↑ 5 ; follow-up: ↓ 7 Changed 6 years ago by 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.
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.
comment:7 in reply to: ↑ 6 ; follow-up: ↓ 8 Changed 6 years ago by 0xe2.0x9a.0x9b
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.
comment:8 in reply to: ↑ 7 Changed 6 years ago by andrew_b
Replying to 0xe2.0x9a.0x9b:
Already done that: http://lists.jedsoft.org/lists/slang-devel/2019/0000000.html
Thanks.