iffse / pay-respects

Terminal command suggestion, alternative to thefuck written in Rust with AI support
https://codeberg.org/iff/pay-respects
GNU Affero General Public License v3.0
67 stars 7 forks source link

[Bug]: Not passing some environment variables when calls the corrected command #2

Closed arenekosreal closed 1 year ago

arenekosreal commented 1 year ago

What happened?

I am using ArchLinux with zh_CN.UTF-8 locale, however, when this program runs corrected command, environment variables such as LANG are not passed to the corrected command.

The command and output

Note: this log contains non-English words:

# zhanghua @ archlinux in ~ [12:38:59]
$ pacman -S
错误:非 root (根用户) 无法执行指定操作。
# zhanghua @ archlinux in ~ [12:39:02] C:1 
$ f
sudo pacman -S

Press enter to execute the suggestion. Or press Ctrl+C to exit.

[sudo] password for zhanghua: 
error: no targets specified (use -h for help)

# zhanghua @ archlinux in ~ [12:39:10]
$ 

The sudo command called by pay-respects seems that it does not have the proper LANG environment variable so its outputs becomes English

No similar issue

iffse commented 1 year ago

Fixed by 214f84f