Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attachment download stderr in Windows #507

Open
Andrikin opened this issue Nov 27, 2024 · 5 comments
Open

Attachment download stderr in Windows #507

Andrikin opened this issue Nov 27, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Andrikin
Copy link

Hi there! Big fan of himalaya here! I'm using himalaya, with himalaya-vim (neovim), in past few days and I'm enjoying a lot! But recently, in himalaya-vim, when downloading attachments, this always return error in himalaya-vim, but the files are being downloaded correctly. Checking the command for download attachments, I verify that the output messages of himalaya are being redirect to stderr. This is the command I made in cmd (Windows 7 and 10 too):

himalaya.exe -c attachment download --account --folder 2> stderr-test.txt

The messages output to stderr are info messages, like:

1 attachment(s) found for message !
Downloading "C:\Users\user\file.pdf"…

I think this could be send to stdout, not stderr.

I'm improving my english, so any feedback would be appreciated.

@soywod
Copy link
Member

soywod commented Nov 29, 2024

I am not sure, but I think it has been fixed on master recently. Which version do you use, and how did you installed it?

@soywod soywod added the question Further information is requested label Nov 29, 2024
@Andrikin
Copy link
Author

I use pre-release 53dc4c2 himalaya-x86_64-windows. The lastest version don't work for Windows 7... (get kernel32.dll error: GetSystemTimePreciseAsTime).

I will try use the last one, f9f2aae, on another computer, with Windows 10 and report it to you.

@soywod
Copy link
Member

soywod commented Nov 29, 2024

Curious to know if f9f2aae will work, last builds are supposed to be statically linked and should work like before. But I did not have the opportunity to try on a Windows machine (nor a MacOS).

@Andrikin
Copy link
Author

Andrikin commented Nov 30, 2024

Try attachment download command with f9f2aae, Windows 11, and this result in those info messages on stderr output.

stderr:

2 attachment(s) found for message id!
Downloading "\\?\C:\Users\user\Downloads\himalaya\mail\file.pdf"…

stdout:

Downloaded 2 attachment(s) from 1 messages(s)!

If you need it, I can leave here --debug and --trace report.

@soywod
Copy link
Member

soywod commented Dec 1, 2024

Happy to hear that the last statically-linked builds work as expected on Windows.

I finally took time to properly read your initial issue, which in fact is not really one. It is a common practice to write down logs to stderr, see for example env_logger:

By default, env_logger writes logs to stderr, but can be configured to instead write them to stdout.

It prevents logs to interfeer with regular output. It also allow you to redirect logs to a file. I noticed that not all logs were actually written to stderr, this fix should land soon on master: pimalaya/tui@d9732f6.

That said, the Vim plugin should not treat them as error. It used to work, so maybe sth changed recently. I'm still in the process of releasing Himalaya CLI v1, as soon as it is ready I will take care of Emacs and Vim plugins. I let you know!

@soywod soywod added bug Something isn't working and removed question Further information is requested labels Dec 1, 2024
@soywod soywod added this to Pimalaya Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants