[GH-ISSUE #59] [Bug] ext_viewer_cmd option can't use terminal-based readers #57

Closed
opened 2026-03-03 01:19:26 +03:00 by kerem · 2 comments
Owner

Originally created by @sc0ttj on GitHub (Nov 19, 2020).
Original GitHub issue: https://github.com/d99kris/nmail/issues/59

I have tried to set ext_viewer_cmd to use various terminal-based programs to view attachments...

And have encountered some bugs/issues:

  1. ext_viewer_cmd can't take commands with spaces, even in quotes (ext_viewer_cmd="bat -p")
  2. Any terminal based reader I have chosen that does run causes rendering issues when returning to nmail
  3. It refuses to open files without extensions (should maybe fallback to $PAGER or $EDITOR)

About point 2 specifically:

All of the below is using mlterm.. But I also tried xterm and st. All terminals behaved the same.

Using ext_viewer_cmd=w3m:

  • I can view the attachments
  • I can use Q key to return to nmail..
  • but after returning, much of the nmail UI headings are missing, I can see my PS1 prompt instead.
  • but nmail is basically still usable in this state

Using ext_viewer_cmd=bat:

  • I can view the attachment
  • I cannot press q to return to nmail, it just quits back to terminal

Using ext_viewer_cmd=micro:

  • I can view/edit the attachment in micro
  • I press Ctrl-Q, it takes me back to nmail, but I can't see it (I see PS1 and blank terminal screen), and using any arrow keys shows nmail errors
  • I can press q to quit nmail (cant see it so don't know what else to do)

Using ext_viewer_cmd=lynx:

Same as micro (except I used qy to quit).

Using ext_viewer_cmd=less:

Same as micro (except I used q to quit).


All of this is on FossPup64 .. (largely based on Ubuntu packages)

Originally created by @sc0ttj on GitHub (Nov 19, 2020). Original GitHub issue: https://github.com/d99kris/nmail/issues/59 I have tried to set `ext_viewer_cmd` to use various terminal-based programs to view attachments... And have encountered some bugs/issues: 1. `ext_viewer_cmd` can't take commands with spaces, even in quotes (`ext_viewer_cmd="bat -p"`) 2. Any terminal based reader I have chosen that _does_ run causes rendering issues when returning to `nmail` 3. It refuses to open files without extensions (should maybe fallback to $PAGER or $EDITOR) About point 2 specifically: All of the below is using `mlterm`.. But I also tried `xterm` and `st`. All terminals behaved the same. Using `ext_viewer_cmd=w3m`: - I can view the attachments - I can use `Q` key to return to nmail.. - but after returning, much of the nmail UI headings are missing, I can see my PS1 prompt instead. - but nmail is basically still usable in this state Using `ext_viewer_cmd=bat`: - I can view the attachment - I cannot press `q` to return to nmail, it just quits back to terminal Using `ext_viewer_cmd=micro`: - I can view/edit the attachment in micro - I press Ctrl-Q, it takes me back to nmail, but I can't see it (I see PS1 and blank terminal screen), and using any arrow keys shows nmail errors - I can press `q` to quit nmail (cant see it so don't know what else to do) Using `ext_viewer_cmd=lynx`: Same as `micro` (except I used `qy` to quit). Using `ext_viewer_cmd=less`: Same as `micro` (except I used `q` to quit). --- All of this is on FossPup64 .. (largely based on Ubuntu packages)
kerem closed this issue 2026-03-03 01:19:27 +03:00
Author
Owner

@d99kris commented on GitHub (Nov 20, 2020):

Hi @sc0ttj - thanks for the detailed bug report!

I'm able to reproduce the problem using ext_viewer_cmd=w3m on macOS.

External pager and editor already supports console-based external applications, so it should be fairly simple to fix.

<!-- gh-comment-id:731198618 --> @d99kris commented on GitHub (Nov 20, 2020): Hi @sc0ttj - thanks for the detailed bug report! I'm able to reproduce the problem using `ext_viewer_cmd=w3m` on macOS. External pager and editor already supports console-based external applications, so it should be fairly simple to fix.
Author
Owner

@d99kris commented on GitHub (Nov 20, 2020):

I've pushed a fix for this now. Feel free to reopen this issue if you're still encountering any issues.

Thanks again for reporting the bug and helping to improve nmail!

<!-- gh-comment-id:731199887 --> @d99kris commented on GitHub (Nov 20, 2020): I've pushed a fix for this now. Feel free to reopen this issue if you're still encountering any issues. Thanks again for reporting the bug and helping to improve nmail!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nmail#57
No description provided.