mdp icon indicating copy to clipboard operation
mdp copied to clipboard

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

Open c02y opened this issue 9 years ago • 27 comments

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

c02y avatar Sep 18 '14 08:09 c02y

what occured to me too. can someone solve this ?

ghost avatar Sep 18 '14 08:09 ghost

+1

alahache avatar Sep 18 '14 08:09 alahache

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

visit1985 avatar Sep 18 '14 11:09 visit1985

@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

c02y avatar Sep 18 '14 13:09 c02y

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).

drewsberry avatar Sep 18 '14 14:09 drewsberry

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 avatar Sep 18 '14 16:09 edthedev

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.

edthedev avatar Sep 18 '14 16:09 edthedev

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.

visit1985 avatar Sep 18 '14 17:09 visit1985

The new error messages work great. Thanks!

edthedev avatar Sep 22 '14 15:09 edthedev

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

visit1985 avatar Sep 27 '14 10:09 visit1985

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 avatar Jun 27 '15 17:06 matthiasbeyer

Forget what I've said. Was my fault.

matthiasbeyer avatar Jun 27 '15 17:06 matthiasbeyer

Just for reference: 4ebae8ba8f3700f740d2705f7a3c2dc92f4995dc

visit1985 avatar Jun 27 '16 21:06 visit1985

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

oising avatar Aug 26 '17 19:08 oising

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.

JensKorte avatar Oct 01 '17 20:10 JensKorte

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 avatar Apr 22 '19 09:04 ersi-dnd

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.

ersi-dnd avatar Apr 22 '19 10:04 ersi-dnd

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?

iamtodor avatar Feb 05 '20 16:02 iamtodor

Getting this too.

dessalines avatar Feb 25 '20 15:02 dessalines

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

hopeseekr avatar Oct 14 '20 16:10 hopeseekr

this is still an issue

jmdugan avatar Oct 16 '20 14:10 jmdugan

bump

ubuntupunk avatar Oct 23 '21 09:10 ubuntupunk

How hard can it be to fix this?

tuxick avatar Mar 25 '22 12:03 tuxick

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

devnoot avatar Jul 12 '22 19:07 devnoot

Same issue

action-server avatar Mar 06 '23 21:03 action-server

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.

gpm1982 avatar Sep 07 '23 07:09 gpm1982

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

gigaray avatar Feb 17 '24 17:02 gigaray