Skip to content

Conversation

@fransklaver
Copy link

To capture logs into a file we redirect stdout and stdin to a log file, but this is currently only done if stdout or stdin are tty's. Whenever eww is started from a background task, that is not directly from a terminal, stdout and stdin aren't tty's and nothing is written to the log files as a result.

I see no reason to require stdout and stdin to be ttys and I don't see any other checks that would make sense instead, so just remove the isatty checks for stdout and stdin, and just always redirect them.

Additional Notes

I'm not sure why this check was in place. It has been there for quite some time and it bugged me that I only got log output once I manually restarted eww.

Checklist

Please make sure you can check all the boxes that apply to this PR.

  • I used cargo fmt to automatically format all code before committing

To capture logs into a file we redirect stdout and stdin to a log file,
but this is currently only done if stdout or stdin are tty's. Whenever
eww is started from a background task, that is not directly from a
terminal, stdout and stdin aren't tty's and nothing is written to the
log files as a result.

I see no reason to require stdout and stdin to be ttys and I don't see
any other checks that would make sense instead, so just  remove the
isatty checks for stdout and stdin, and just always redirect them.
@fransklaver fransklaver force-pushed the always-redirect-stdout-stdin branch from 8144416 to 544914a Compare October 7, 2025 06:37
Copy link
Contributor

@w-lfchen w-lfchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems reasonable to me

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.

2 participants