It's not possible to pipe output of fetch to a file or a pager
fetch -i mallard | less -R
Traceback (most recent call last):
File "/usr/local/bin/fetch", line 11, in <module>
load_entry_point('yashsinghcodes==0.1', 'console_scripts', 'fetch')()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 476, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2700, in load_entry_point
return ep.load()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2318, in load
return self.resolve()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2324, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "/usr/local/lib/python3.6/site-packages/yashsinghcodes-0.1-py3.6.egg/fetch/__init__.py", line 4, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "/usr/local/lib/python3.6/site-packages/yashsinghcodes-0.1-py3.6.egg/fetch/fetch.py", line 3, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "/usr/local/lib/python3.6/site-packages/yashsinghcodes-0.1-py3.6.egg/fetch/info.py", line 18, in <module>
OSError: [Errno 25] Inappropriate ioctl for device
It's not possible to pipe output of fetch to a file or a pager
fetch -i mallard | less -R
In fetch/info.py I changed
width,height = os.get_terminal_size()
to
to get it to work