Skip to content

direnv error output gets removed by my terminal #1431

@0xBigBoss

Description

@0xBigBoss

Describe the bug
The recent direnv error message for allowing a .envrc attempting to load an unapproved .envrc seems to have non-terminated output. Which causes my terminal prompt to clear it which is mildly annoying.

on my linux box, it outputs with that % character.

Image

running direnv reload on a directory I haven't approved shows no error output.

on my macosx, I don't even see the output.

Image

Expected behavior
I expect the error message to show the error message without being cleared.

Environment
zsh 5.9 (x86_64-pc-linux-gnu)
zsh 5.9 (arm-apple-darwin23.0.0)
Direnv version 2.36.0

Additional context
happy to provide any other context, i haven't looked at the direnv source yet so pardon my ignorance if I'm shooting myself in the foot somewhere.

I examined the stderr output like so

cd function-localnet 2> error_output.txt
cat error_output.txt | hexdump -C


00000000  1b 5b 33 31 6d 1b 5b 33  31 6d 64 69 72 65 6e 76  |.[31m.[31mdirenv|
00000010  3a 20 65 72 72 6f 72 20  2f 61 70 70 2f 66 75 6e  |: error /app/fun|
00000020  63 74 69 6f 6e 2d 6c 6f  63 61 6c 6e 65 74 2f 2e  |ction-localnet/.|
00000030  65 6e 76 72 63 20 69 73  20 62 6c 6f 63 6b 65 64  |envrc is blocked|
00000040  2e 20 52 75 6e 20 60 64  69 72 65 6e 76 20 61 6c  |. Run `direnv al|
00000050  6c 6f 77 60 20 74 6f 20  61 70 70 72 6f 76 65 20  |low` to approve |
00000060  69 74 73 20 63 6f 6e 74  65 6e 74 1b 5b 30 6d     |its content.[0m|
0000006f

Should there be a newline at the end?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions