Problem:
I was creating a git hook (commit-msg) with inquirer to choose things for commits.
When doing so, it gave an error (below).
When using a git hook without python-inquirer, git hooks work fine. When using python-inquirer without a githook, python-inquirer works fine.
Is there any solution for this right now or is it a bug?
Traceback:
Traceback (most recent call last):
File "/mnt/d/me/Documents/Code/gitmoji-selector/hooks/commit-msg", line 78, in <module>
gitmoji = gitmoji_prompt()
File "/mnt/d/me/Documents/Code/gitmoji-selector/hooks/commit-msg", line 70, in gitmoji_prompt
answers = inquirer.prompt(questions)
File "/home/me/.local/share/virtualenvs/gitmoji-selector-6Rk4eBwW/lib/python3.9/site-packages/inquirer/prompt.py", line 13, in prompt
answers[question.name] = render.render(question, answers)
File "/home/me/.local/share/virtualenvs/gitmoji-selector-6Rk4eBwW/lib/python3.9/site-packages/inquirer/render/console/__init__.py", line 41, in render
return self._event_loop(render)
File "/home/me/.local/share/virtualenvs/gitmoji-selector-6Rk4eBwW/lib/python3.9/site-packages/inquirer/render/console/__init__.py", line 54, in _event_loop
self._process_input(render)
File "/home/me/.local/share/virtualenvs/gitmoji-selector-6Rk4eBwW/lib/python3.9/site-packages/inquirer/render/console/__init__.py", line 98, in _process_input
ev = self._event_gen.next()
File "/home/me/.local/share/virtualenvs/gitmoji-selector-6Rk4eBwW/lib/python3.9/site-packages/inquirer/events.py", line 22, in next
return KeyPressed(self._key_gen())
File "/home/me/.local/share/virtualenvs/gitmoji-selector-6Rk4eBwW/lib/python3.9/site-packages/readchar/readchar.py", line 88, in readkey
c1 = getchar()
File "/home/me/.local/share/virtualenvs/gitmoji-selector-6Rk4eBwW/lib/python3.9/site-packages/readchar/readchar_linux.py", line 12, in readchar
old_settings = termios.tcgetattr(fd)
termios.error: (25, 'Inappropriate ioctl for device')
Relevant code:
def gitmoji_prompt() -> str: # line 61
questions = [
inquirer.List("gitmoji",
message="Choose a gitmoji",
choices=[
f'{i["emoji"]}\t- {i["description"]}'
for i in get_gitmojis()
])
]
answers = inquirer.prompt(questions) # line 70
return answers["gitmoji"].split("\t")[0]
Problem: I was creating a git hook (
commit-msg
) with inquirer to choose things for commits. When doing so, it gave an error (below). When using a git hook without python-inquirer, git hooks work fine. When using python-inquirer without a githook, python-inquirer works fine. Is there any solution for this right now or is it a bug?Traceback:
Relevant code: