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

less --file-size (Windows) #168

Closed
adoxa opened this issue May 16, 2021 · 5 comments
Closed

less --file-size (Windows) #168

adoxa opened this issue May 16, 2021 · 5 comments

Comments

@adoxa
Copy link
Contributor

adoxa commented May 16, 2021

less --file-size FILE leaves behind the length message.

C:\Projects\less>less --file-size less.man
Determining length of file... (interrupt to abort)
C:\Projects\less>

I tried adding ierror("", NULL_PARG), but that still leaves the abort part. Could just use clear_bot(), but that leaves need_clr set (not that it matters too much, I guess).

@gwsw
Copy link
Owner

gwsw commented May 16, 2021

I'm confused -- on Linux at least, ierror sets need_clr which causes putchr to call clear_bot. The clear_bot erases the Determining message. I would expect this all to work the same on Windows, so I don't understand why you are seeing the message. If I run with termcap debug on I see

$ echo hello | LESS_TERMCAP_DEBUG=1 less --file-size 
<cr><cd><so>Determining length of file... (interrupt to abort)<se><cr><cd><ti><ks><cr>hello
<so>(END)<se><ce>

The "<cr><cd>" after the message represents a call to clear_bot.

@adoxa
Copy link
Contributor Author

adoxa commented May 17, 2021

Don't compare Windows & Linux. ;) It would seem this message (and the "binary" one) are displayed before the console switches screens. I don't think that can be done earlier because of -F (but even so it probably wouldn't be right for the "binary" one).

@gwsw
Copy link
Owner

gwsw commented May 17, 2021

Yes, the Determining message is displayed before switching screens, but the clear_bot should also happen before switching screens. Ah, perhaps the difference is Linux uses putchr to send the init ("ti") sequence, which invokes clear_bot, but Windows doesn't call putchr anywhere in init(). Maybe the need_clr/clear_bot check that's in putchr should be done explicitly at the start of init().

@gwsw
Copy link
Owner

gwsw commented May 17, 2021

Let me know if 81c1184 fixes this in Windows.

@adoxa
Copy link
Contributor Author

adoxa commented May 18, 2021

Yep, that got it, thanks.

@adoxa adoxa closed this as completed May 18, 2021
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