Skip to content

Conversation

@timabell
Copy link
Owner

Pipe stdin, stdout, and stderr when executing commands through
gitopolis exec. This prevents commands from detecting a TTY and
stops them from launching pagers, prompts, or other interactive
features.

Commands now run in a non-interactive environment where:

  • stdin is set to null (no input available)
  • stdout/stderr are piped and streamed line-by-line to the terminal

This ensures git commands (and other CLI tools) won't pause for
pagers or prompts that would hang the execution.

Updated README.md to document the non-interactive behavior and its
implications:

  • Git defaults to no-color (can re-enable with --color flag)
  • SSH/GPG keys must be pre-loaded in ssh-agent
  • Remote SSH hosts must be in known_hosts

Applied to both repo_exec() and repo_exec_oneline() functions on
both Unix and Windows platforms.

Prompts:

  • any idea how to fix this exec git log not turning off pager · Issue #230 · timabell/gitopolis
  • in response to: isn't that going to cause problems for cmd in windows? maybe only change if for unix builds
  • in response to: will empty string work? if so do that on all
  • in response to: is there a better way to tell git (and other cli commands) that it's non-interactive
  • in response to: can we make stdout not a tty?
  • in response to: that doesn't work, git is still paging with less. also give me a command i can use to test what other apps would generically be like
  • in response to: add a note to the readme that commands run with exec are not tty to avoid hanging due to prompts, note that git will then default to no-colour but it can be re-enabled with --color
  • in response to: add to that that this means you'll have to have your ssh/gpg keys already loaded and unlocked in ssh-agent or similar, and that remote ssh ids will need to already be accepted

Fixes #230

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

timabell and others added 3 commits October 26, 2025 00:30
Pipe stdin, stdout, and stderr when executing commands through
gitopolis exec. This prevents commands from detecting a TTY and
stops them from launching pagers, prompts, or other interactive
features.

Commands now run in a non-interactive environment where:
- stdin is set to null (no input available)
- stdout/stderr are piped and streamed line-by-line to the terminal

This ensures git commands (and other CLI tools) won't pause for
pagers or prompts that would hang the execution.

Updated README.md to document the non-interactive behavior and its
implications:
- Git defaults to no-color (can re-enable with --color flag)
- SSH/GPG keys must be pre-loaded in ssh-agent
- Remote SSH hosts must be in known_hosts

Applied to both repo_exec() and repo_exec_oneline() functions on
both Unix and Windows platforms.

Prompts:
- any idea how to fix this [exec git log not turning off pager · Issue #230 · timabell/gitopolis](#230)
- in response to: isn't that going to cause problems for cmd in windows? maybe only change if for unix builds
- in response to: will empty string work? if so do that on all
- in response to: is there a better way to tell git (and other cli commands) that it's non-interactive
- in response to: can we make stdout not a tty?
- in response to: that doesn't work, git is still paging with less. also give me a command i can use to test what other apps would generically be like
- in response to: add a note to the readme that commands run with exec are not tty to avoid hanging due to prompts, note that git will then default to no-colour but it can be re-enabled with --color
- in response to: add to that that this means you'll have to have your ssh/gpg keys already loaded and unlocked in ssh-agent or similar, and that remote ssh ids will need to already be accepted

Fixes #230

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Windows test failed because new output streaming now normalizes crlf to lf.

https://github.com/timabell/gitopolis/actions/runs/18809920700/job/53669470126?pr=237

Happy to keep it like that until it proves to be an actual problem.
Replaced escaped string literals with raw strings in both
exec_with_special_chars and exec_with_multiple_tag_groups tests. This makes
the test expectations much easier to read and maintain while preserving the
same functionality.

Prompts:
- committed. now we can revert those test assertions back to normal raw strings for clarity
- exec_with_multiple_tag_groups test needs doing too

Co-Authored-By: Claude <noreply@anthropic.com>
@timabell timabell merged commit 3f713a2 into main Oct 25, 2025
6 checks passed
@timabell timabell deleted the disable-git-pager branch October 25, 2025 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

exec git log not turning off pager

2 participants