aitjcize / cppman

C++ 98/11/14 manual pages for Linux/MacOS
GNU General Public License v3.0
1.27k stars 79 forks source link

Pager issues on OS X #56

Closed superfunc closed 8 years ago

superfunc commented 8 years ago

When trying to double click, or press enter, on a function name in the page. The following error message is displayed in the vim buffer.

Error Message: error: [Errno 19] Operation not supported by device.

Relevant Software Versions:

eborisch commented 8 years ago

The issue is with the ws = fcntl.ioctl(0, termios.TIOCGWINSZ, ws) line in cppman/util.py -- when cppman is re-run (which is what is happening) by vim on OS X, this is returning ENODEV.

Placing this line (and the next) in a try.. except.. and returning some dummy values: lines, columns, x, y = (24, 80, 0, 0) in the except... is enough to get it working, but I haven't looked for unintended consequences...

aitjcize commented 8 years ago

I think there is an alternative for TIOCGWSINZ on OS X, I'll look into it.

eborisch commented 8 years ago

Perhaps calling 'tput cols' would be an alternative? I haven't tried it here to see how it reacts in this particular situation.

eborisch commented 8 years ago

I've added a cppman port to MacPorts, including this patch which appears to resolve (was broken, now fixed for me) this issue: https://trac.macports.org/browser/trunk/dports/lang/cppman/files/cppman_util_py.patch?rev=145849

aitjcize commented 8 years ago

Yeah that works. Let me include this patch.

aitjcize commented 8 years ago

I've send 5cd2e74 to fix this issue. I don't use 'tput' to avoid the external dependency.

aitjcize commented 8 years ago

@eborisch Thanks for maintaining the MacPorts package btw!

superfunc commented 8 years ago

Thanks to everyone for working on this!