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

Error: Terminal size 135x34 too small. Need at least 683x1242. #15

Open
c02y opened this issue Sep 18, 2014 · 27 comments
Open

Error: Terminal size 135x34 too small. Need at least 683x1242. #15

c02y opened this issue Sep 18, 2014 · 27 comments

Comments

@c02y
Copy link

c02y commented Sep 18, 2014

After installation, and mdp my_own.md, there are some long lines in my_own.md file,
it shows:"Error: Terminal size 135x34 too small. Need at least 683x1242.".
But my terminal is already in fullscreen mode, it should wrap long lines automatically to adjust the size of the terminal when in terminal presentation mode.

FYI: 1366x768 14 Inch Screen Laptop

Update:
I could have mentioned that the sample.md is totally fine in my terminal, maybe because the lines in the file are short, and I tried mdp for several other markdown files, all errors with the same message(different rows x columns of course).

As I said:"it should wrap long lines automatically to adjust the size of the terminal when in terminal presentation mode."

Platform: Fedora 20, 32-bit

@ghost
Copy link

ghost commented Sep 18, 2014

what occured to me too. can someone solve this ?

@alahache
Copy link

+1

@visit1985
Copy link
Owner

What OS are you using? If the sample.md has the same issue, it is most likely a problem with the line break recognition.

@c02y
Copy link
Author

c02y commented Sep 18, 2014

@visit1985 I could have mentioned that the sample.md is totally fine in my terminal, maybe because the lines in the file are short, and I tried mdp for several markdown files, all errors with the same message(different size of course).

As I said:"it should wrap long lines automatically to adjust the size of the terminal when in terminal presentation mode."

Platform: Fedora 20, 32-bit

@drewsberry
Copy link

I too am getting this on Ubuntu 14.04, 32-bit. Basically, it's not wrapping any of the lines, meaning sample.md is fine as long as the terminal size is at least 44x18, whereas other markdown files with very long lines are literally impossible to display, because they need e.g. 733x18, which is unfeasible (a terminal stretching across both my screens takes up 360x21).

@edthedev
Copy link

For cases where the error message is valid, an additional line in the error output would be helpful:

"You may need to add additional slide breaks ('***') to the file, or shorten some lines to fewer columns."

@edthedev
Copy link

No issue with sample.md on Mac OSX 10.9.

But pointing mdp at other pre-existing .md files pretty much guarantees this message occurring; so we should try to make it as helpful as possible.

@visit1985
Copy link
Owner

The documentation is not very well until now. But as you can see in sample.md, pages (slides) are split by --- or ***, which is the markdown representaton of a horizontal ruler (HR) in HTML.

If you use existing markdown files. You need to ensure, that there are enough of these rulers in your file, so each slide fits in your terminal. As HR is not used very often in general, this may fail for existing markdown files without customization.

Another point is, that lines are too long. Line wrapping is not jet implemented. The main difficulty here is, that the terminal size is unknown when the file is parsed. Thus it is necessary to calculate the amount of lines per slide while displaying it which is a bit more difficult. But i'll try my best.

The extended error message is a good idea too. I'll add that.

For now, you need to reformat your existing markdown files to fit in your terminals lines/columns.

@edthedev
Copy link

The new error messages work great. Thanks!

@visit1985
Copy link
Owner

c6516c7 solves it partially I think. But we need some more logic for correct word division.

@matthiasbeyer
Copy link

Error: Terminal height (81 lines) too small. Need at least 579 lines.
You may need to add additional horizontal rules (---) to split your file in shorter slides.

With the sample.md from latest master.

@matthiasbeyer
Copy link

Forget what I've said. Was my fault.

@visit1985
Copy link
Owner

Just for reference: 4ebae8b

@oising
Copy link

oising commented Aug 26, 2017

Am I just missing the point completely or is the most sensible fix to just have vertical scrolling like a pager?

@JensKorte
Copy link

Would it be possible to extend the error message to something like:

Need at least 279 lines for slide #2 starting at line 31.
Old one:
Need at least 279 lines for slide #2.

@ersi-dnd
Copy link

ersi-dnd commented Apr 22, 2019

I would like to complain about this the other way. The standard terminal size is 80 characters and 24 lines. The sample.md file needs 25 lines for slide number 7. I stripped the URL in the slide and then it fit perfectly.

Perhaps it is best that sample.md informs users about the standard terminal size and suggests they abide by it. Slides with other geometry could be permitted as an explicit option. Same for wrapping: out of the box 80 characters per line is the limit, while softwrapping is an option.

I think the current error messages and behaviour (exit with error) are okay, but perhaps there could be yet another option: Of the overreaching slides, display only as much as possible and truncate the rest. This is a slideshow program, it should most of all respect the slide markers and display as much as possible within those limits.

@ersi-dnd
Copy link

ersi-dnd commented Apr 22, 2019

After some testing, I recommend using a hardwrapping text editor to write the source files. The recommended maximum wrapping point is at 76 characters. (It will cause issues with e.g. long URL's and that's yet another thing, in addition to line count, to be observed when composing the source.)

Hardwrapping the source text at 76 characters is recommended given the traditional standard terminal geometry: 80 characters and 24 lines. Wrapping at 76 characters leaves a small nice margin.

And it is also recommended to include this info in the sample.md file.

@iamtodor
Copy link

iamtodor commented Feb 5, 2020

Have the same problem:

Error: Terminal height (50 lines) too small. Need at least 62 lines for slide #1.
You may need to add additional horizontal rules (---) to split your file in shorter slides.

MacOS 10.15.2
mdp 1.0.15
iterm 3.3.8

How to fix it properly?

@dessalines
Copy link

Getting this too.

@hopeseekr
Copy link

This is a completely stupid program.

This WONT_FIX bug for over 6 years, the maintainer needs to hold his head in shame!! I’m surprised such a glaring bug hasn’t damaged his hireability. If I viewed his GitHub repos, tried his #1 one (this one) and got this error and saw this bug report, I 100% would not hire him.

I ended up using mdr, which does exactly what I wanted.

npm install -g mdr

mdr example

@jmdugan
Copy link

jmdugan commented Oct 16, 2020

this is still an issue

@ubuntupunk
Copy link

bump

@tuxick
Copy link

tuxick commented Mar 25, 2022

How hard can it be to fix this?

@devnoot
Copy link

devnoot commented Jul 12, 2022

This is a completely stupid program.

This WONT_FIX bug for over 6 years, the maintainer needs to hold his head in shame!! I’m surprised such a glaring bug hasn’t damaged his hireability. If I viewed his GitHub repos, tried his #1 one (this one) and got this error and saw this bug report, I 100% would not hire him.

I ended up using mdr, which does exactly what I wanted.

npm install -g mdr

mdr example

Bro it's open source and you're free to PR it.. It's annoying bug for sure but there's no reason to attack the developer

@action-server
Copy link

Same issue

@gpm1982
Copy link

gpm1982 commented Sep 7, 2023

I've experienced the same error myself, but was able to fix it by converting the line ending from Windows-style (CRLF) to Linux-style (LF) using dos2unix tool. Not sure if this is the case for all of you, but it is for me.

@gigaray
Copy link

gigaray commented Feb 17, 2024

fabulous program - very neat idea!

i started by copy and paste the sample.md with notepad++ and it continued working as I kept making changes to the .md file to suit my needs.

@gpm1982 - thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests