Title: Problem executing cz commit in prepare-commit-msg hook on Mac · Issue #1386 · commitizen-tools/commitizen · GitHub
Open Graph Title: Problem executing cz commit in prepare-commit-msg hook on Mac · Issue #1386 · commitizen-tools/commitizen
X Title: Problem executing cz commit in prepare-commit-msg hook on Mac · Issue #1386 · commitizen-tools/commitizen
Description: Description I have a hook that attempts to redirect to commitzen like so exec < /dev/tty && cz commit || true This works on linux. Unfortunately at work we are on Mac 👎 This is the error I get File "/opt/homebrew/bin/cz", line 8, in Open Graph Description: Description I have a hook that attempts to redirect to commitzen like so exec < /dev/tty && cz commit || true This works on linux. Unfortunately at work we are on Mac 👎 This is the error I get File...
X Description: Description I have a hook that attempts to redirect to commitzen like so exec < /dev/tty && cz commit || true This works on linux. Unfortunately at work we are on Mac 👎 This is the error...
Opengraph URL: https://github.com/commitizen-tools/commitizen/issues/1386
X: @github
Domain: github.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Problem executing cz commit in prepare-commit-msg hook on Mac","articleBody":"### Description\n\nI have a hook that attempts to redirect to commitzen like so\n\n`exec \u003c /dev/tty \u0026\u0026 cz commit || true`\n\nThis works on linux. Unfortunately at work we are on Mac 👎 \n\nThis is the error I get\n\n`File \"/opt/homebrew/bin/cz\", line 8, in \u003cmodule\u003e\n sys.exit(main())\n ~~~~^^\n File \"/opt/homebrew/Cellar/commitizen/4.5.1/libexec/lib/python3.13/site-packages/commitizen/cli.py\", line 656, in main\n args.func(conf, arguments)()\n ~~~~~~~~~~~~~~~~~~~~~~~~~~^^\n File \"/opt/homebrew/Cellar/commitizen/4.5.1/libexec/lib/python3.13/site-packages/commitizen/commands/commit.py\", line 127, in __call__\n m = self.prompt_commit_questions()\n File \"/opt/homebrew/Cellar/commitizen/4.5.1/libexec/lib/python3.13/site-packages/commitizen/commands/commit.py\", line 58, in prompt_commit_questions\n answers = questionary.prompt(questions, style=cz.style)\n File \"/opt/homebrew/Cellar/commitizen/4.5.1/libexec/lib/python3.13/site-packages/questionary/prompt.py\", line 78, in prompt\n return unsafe_prompt(questions, answers, patch_stdout, true_color, **kwargs)\n File \"/opt/homebrew/Cellar/commitizen/4.5.1/libexec/lib/python3.13/site-packages/questionary/prompt.py\", line 221, in unsafe_prompt\n answer = question.unsafe_ask(patch_stdout)\n File \"/opt/homebrew/Cellar/commitizen/4.5.1/libexec/lib/python3.13/site-packages/questionary/question.py\", line 89, in unsafe_ask\n return self.application.run()\n ~~~~~~~~~~~~~~~~~~~~^^\n File \"/opt/homebrew/Cellar/commitizen/4.5.1/libexec/lib/python3.13/site-packages/prompt_toolkit/application/application.py\", line 1002, in run\n return asyncio.run(coro)\n ~~~~~~~~~~~^^^^^^\n File \"/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/runners.py\", line 195, in run\n return runner.run(main)\n ~~~~~~~~~~^^^^^^\n File \"/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/runners.py\", line 118, in run\n return self._loop.run_until_complete(task)\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^\n File \"/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/base_events.py\", line 725, in run_until_complete\n return future.result()\n ~~~~~~~~~~~~~^^\n File \"/opt/homebrew/Cellar/commitizen/4.5.1/libexec/lib/python3.13/site-packages/prompt_toolkit/application/application.py\", line 886, in run_async\n return await _run_async(f)\n ^^^^^^^^^^^^^^^^^^^\n File \"/opt/homebrew/Cellar/commitizen/4.5.1/libexec/lib/python3.13/site-packages/prompt_toolkit/application/application.py\", line 734, in _run_async\n with self.input.raw_mode(), self.input.attach(\n ~~~~~~~~~~~~~~~~~^\n read_from_input_in_context\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n ), attach_winch_signal_handler(self._on_resize):\n ^\n File \"/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py\", line 141, in __enter__\n return next(self.gen)\n File \"/opt/homebrew/Cellar/commitizen/4.5.1/libexec/lib/python3.13/site-packages/prompt_toolkit/input/vt100.py\", line 165, in _attached_input\n loop.add_reader(fd, callback_wrapper)\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/selector_events.py\", line 347, in add_reader\n self._add_reader(fd, callback, *args)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/selector_events.py\", line 279, in _add_reader\n self._selector.register(fd, selectors.EVENT_READ,\n ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^\n (handle, None))\n ^^^^^^^^^^^^^^^\n File \"/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/selectors.py\", line 505, in register\n self._selector.control([kev], 0, 0)\n ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^\nOSError: [Errno 22] Invalid argument`\n\nI am not sure what the Invalid argument is given that no arguments are being passed to the command.\n\n### Steps to reproduce\n\n1. Buy a Mac\n2. Create a github prepare-commit-msg hook in your project\n3. Git commit\n\n### Current behavior\n\nStack trace\n\n### Desired behavior\n\nWorks\n\n### Screenshots\n\n_No response_\n\n### Environment\n\n- commitizen version : 4.5.1","author":{"url":"https://github.com/suityou01","@type":"Person","name":"suityou01"},"datePublished":"2025-04-15T10:06:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1386/commitizen/issues/1386"}
route-pattern /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) route-controller voltron_issues_fragments route-action issue_layout fetch-nonce v2:ad615c04-acad-7eeb-3b6a-6b7601c7317a current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id D430:2DB422:B44E00:F6FF70:6A4DC68B html-safe-nonce 45a90f62ac79fee211a87c7f2e39f1b10cd3e5de41c95224163a99eb46ad62be visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDMwOjJEQjQyMjpCNDRFMDA6RjZGRjcwOjZBNERDNjhCIiwidmlzaXRvcl9pZCI6IjY5MDM5ODE2ODg5NjA2OTc5OTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== visitor-hmac 6f61d13c22d6e600b7e9f86407cd821a440859e331e683d98c653ec570949380 hovercard-subject-tag issue:2995898975 github-keyboard-shortcuts repository,issues,copilot google-site-verification Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I octolytics-url https://collector.github.com/github/collect analytics-location / fb:app_id 1401488693436528 apple-itunes-app app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/commitizen-tools/commitizen/1386/issue_layout twitter:image https://opengraph.githubassets.com/681422f272d27cf433a2b20efdcc001d8572b3b8f64bc00edb0424c70fc3eb8a/commitizen-tools/commitizen/issues/1386 twitter:card summary_large_image og:image https://opengraph.githubassets.com/681422f272d27cf433a2b20efdcc001d8572b3b8f64bc00edb0424c70fc3eb8a/commitizen-tools/commitizen/issues/1386 og:image:alt Description I have a hook that attempts to redirect to commitzen like so exec < /dev/tty && cz commit || true This works on linux. Unfortunately at work we are on Mac 👎 This is the error I get File... og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username suityou01 hostname github.com expected-hostname github.com None 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 turbo-cache-control no-preview go-import github.com/commitizen-tools/commitizen git https://github.com/commitizen-tools/commitizen.git octolytics-dimension-user_id 62252524 octolytics-dimension-user_login commitizen-tools octolytics-dimension-repository_id 106127589 octolytics-dimension-repository_nwo commitizen-tools/commitizen octolytics-dimension-repository_public true octolytics-dimension-repository_is_fork false octolytics-dimension-repository_network_root_id 106127589 octolytics-dimension-repository_network_root_nwo commitizen-tools/commitizen turbo-body-classes logged-out env-production page-responsive disable-turbo false browser-stats-url https://api.github.com/_private/browser/stats browser-errors-url https://api.github.com/_private/browser/errors release 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 ui-target full theme-color #1e2327 color-scheme light dark
URLs of crawlers that visited me.