[GH-ISSUE #11] [Feature request] URL interaction (and, more generally, content editing) #10

Closed
opened 2026-03-03 01:18:54 +03:00 by kerem · 5 comments
Owner

Originally created by @Kabouik on GitHub (Jan 13, 2020).
Original GitHub issue: https://github.com/d99kris/nmail/issues/11

Originally assigned to: @d99kris on GitHub.

Sorry for the numerous feature requests, but those are merely ideas for your to evaluate, I mean no pressure.

Since many emails are sent as HTML (and nmail does a great job dealing with those using Lynx), sometimes it is necessary to open a link to actually read any sensible content — at least when the sender is trustworthy. Yet, at the moment, URLs cannot be interacted with. I know Neomutt uses urlview to list all URL's found in the body of the message and offer a dedicated screen to pick the URL to open, but it also allows just clicking (or Ctrl+Clicking) on URLs to open the in the default browser. That would be nice too.

Actually, anything not requiring too many external dependencies would be good, as one thing I appreciate with nmail is it is almost self-sufficient (except for Lynx). I know the UNIX way is to have one tool for one function and I appreciate that too, but the fact that nmail does not require many external tools is also a strength since some may or may not be available on some distributions or architectures. It also helps with configuration compared to other MUAs like Neomutt or Sup which depend on several tools and configuration file before being usable.

Something that might be related would be the ability to Ctrl+e when reading an e-mail to edit it, and possibly copy some of its content and save it somewhere else. It would be useful when receiving code bits over e-mail for instance, or some text to be reviewed and edited for a collaborative document. Text selection is possible from the terminal, and one can then Shift+Ctrl+C to copy, but it is less powerful.

Originally created by @Kabouik on GitHub (Jan 13, 2020). Original GitHub issue: https://github.com/d99kris/nmail/issues/11 Originally assigned to: @d99kris on GitHub. Sorry for the numerous feature requests, but those are merely ideas for your to evaluate, I mean no pressure. Since many emails are sent as HTML (and nmail does a great job dealing with those using Lynx), sometimes it is necessary to open a link to actually read any sensible content — at least when the sender is trustworthy. Yet, at the moment, URLs cannot be interacted with. I know Neomutt uses `urlview` to list all URL's found in the body of the message and offer a dedicated screen to pick the URL to open, but it also allows just clicking (or Ctrl+Clicking) on URLs to open the in the default browser. That would be nice too. Actually, anything not requiring too many external dependencies would be good, as one thing I appreciate with nmail is it is almost self-sufficient (except for Lynx). I know the UNIX way is to have one tool for one function and I appreciate that too, but the fact that nmail does not require many external tools is also a strength since some may or may not be available on some distributions or architectures. It also helps with configuration compared to other MUAs like Neomutt or Sup which depend on several tools and configuration file before being usable. Something that might be related would be the ability to `Ctrl+e` when reading an e-mail to edit it, and possibly copy some of its content and save it somewhere else. It would be useful when receiving code bits over e-mail for instance, or some text to be reviewed and edited for a collaborative document. Text selection is possible from the terminal, and one can then `Shift+Ctrl+C` to copy, but it is less powerful.
kerem closed this issue 2026-03-03 01:18:54 +03:00
Author
Owner

@d99kris commented on GitHub (Jan 13, 2020):

Don't worry, all feedback is welcome! I'll address it when (and if) I find time. :)

Yes the missing URL interaction is a good point. Currently for my own use, I rely on the terminal's handling of this (on Mac it's a Cmd + mouse click on URL). But yes, a keyboard oriented interface would be preferred. I'll look into what options there could be.

Regarding opening an email in an editor, nmail lets you view email content in an external viewer/editor by going to the "MsgParts" (same as were attachments are listed) and selecting the "text/plain" or "text/html" part and pressing > or enter. It will use the configured ext_viewer_cmd to open the content. Would this be sufficient or do you still think a Ctrl+e (or equivalent) would be useful when viewing emails?

I guess we need to get external viewer ext_viewer_cmd working for you before this question can be answered.

<!-- gh-comment-id:573702542 --> @d99kris commented on GitHub (Jan 13, 2020): Don't worry, all feedback is welcome! I'll address it when (and if) I find time. :) Yes the missing URL interaction is a good point. Currently for my own use, I rely on the terminal's handling of this (on Mac it's a Cmd + mouse click on URL). But yes, a keyboard oriented interface would be preferred. I'll look into what options there could be. Regarding opening an email in an editor, nmail lets you view email content in an external viewer/editor by going to the "MsgParts" (same as were attachments are listed) and selecting the "text/plain" or "text/html" part and pressing `>` or `enter`. It will use the configured `ext_viewer_cmd` to open the content. Would this be sufficient or do you still think a `Ctrl+e` (or equivalent) would be useful when viewing emails? I guess we need to get external viewer `ext_viewer_cmd` working for you before this question can be answered.
Author
Owner

@Kabouik commented on GitHub (Jan 13, 2020):

For some reason, the terminal's (Tilix here) handling of URLs did not work for me while it did in Neomutt. I did not investigate thoroughly though. Looking closer now, it seems to work on some URLs. I am having a hard time trying to find what differs between those that are clickable and those that are not, but a couple things that might be worth investigating: presence of hyphens in the URL, and whether the URL is in the present mail or in its history. However this needs more testing, including the same URLs from different terminal emulators.

Oh absolutely, you're right about the text as attachment, I forgot about it. Thanks. I see it also allows opening the html version in browser, nice (although opening temporary files does not work for me yet). I think adding Ctrl+e support would still be useful for those who want to do as much as possible from terminal, as it would allow using $EDITOR in the same window.

<!-- gh-comment-id:573706544 --> @Kabouik commented on GitHub (Jan 13, 2020): For some reason, the terminal's (Tilix here) handling of URLs did not work for me while it did in Neomutt. I did not investigate thoroughly though. Looking closer now, it seems to work on some URLs. I am having a hard time trying to find what differs between those that are clickable and those that are not, but a couple things that might be worth investigating: presence of hyphens in the URL, and whether the URL is in the present mail or in its history. However this needs more testing, including the same URLs from different terminal emulators. Oh absolutely, you're right about the text as attachment, I forgot about it. Thanks. I see it also allows opening the html version in browser, nice (although opening temporary files does not work for me yet). I think adding `Ctrl+e` support would still be useful for those who want to do as much as possible from terminal, as it would allow using $EDITOR in the same window.
Author
Owner

@d99kris commented on GitHub (Jan 14, 2020):

Thanks for the additional info! I think there may be some bug with how nmail breaks URLs longer than the terminal width, I'll look into that separately as well.

Yeah Ctrl+e can probably be added, my only concern is what the functionality "means" to a user if presented in the "help bar". They may think they can edit existing emails in their inbox (which can't really be supported in a good way). But yeah I agree it would be a useful functionality also for me sometime, so I'll consider it.

<!-- gh-comment-id:574115067 --> @d99kris commented on GitHub (Jan 14, 2020): Thanks for the additional info! I think there may be some bug with how `nmail` breaks URLs longer than the terminal width, I'll look into that separately as well. Yeah `Ctrl+e` can probably be added, my only concern is what the functionality "means" to a user if presented in the "help bar". They may think they can edit existing emails in their inbox (which can't really be supported in a good way). But yeah I agree it would be a useful functionality also for me sometime, so I'll consider it.
Author
Owner

@Kabouik commented on GitHub (Jan 14, 2020):

I totally understand your concern about ctrl+e. Perhaps a less ambiguous way would be to add the option in the help bar of the attachments screen only, so that one can open text files with the ctrl+e $EDITOR in addition of the default xdg-open when hitting Return or >? That way, people would more easily understand they are just editing a MsgPart, not the actual body of the mail, and save it as a file, not an email from the index. It may be kind of awkward still, but editing those would require one to acknowledge they are working on files and not on the index content.

<!-- gh-comment-id:574166643 --> @Kabouik commented on GitHub (Jan 14, 2020): I totally understand your concern about `ctrl+e`. Perhaps a less ambiguous way would be to add the option in the help bar of the attachments screen only, so that one can open text files with the `ctrl+e` $EDITOR in addition of the default xdg-open when hitting `Return` or `>`? That way, people would more easily understand they are just editing a MsgPart, not the actual body of the mail, and save it as a file, not an email from the index. It may be kind of awkward still, but editing those would require one to acknowledge they are working on files and not on the index content.
Author
Owner

@d99kris commented on GitHub (Feb 11, 2020):

With above commit I've implemented support for viewing messages in external viewer. By default it uses $PAGER, but with the config setting pager_cmd in ~/.nmail/main.conf one may override it to any command of choice - for example your favourite editor. I figured this would be the most "standards" compliant way to add such functionality. Let me know if it works for you. No rush :)

If you think nmail would still benefit from URL navigation "in app" please re-open this issue, or report a new one, and I'll consider it again. Thanks!

<!-- gh-comment-id:584598828 --> @d99kris commented on GitHub (Feb 11, 2020): With above commit I've implemented support for viewing messages in external viewer. By default it uses `$PAGER`, but with the config setting `pager_cmd` in `~/.nmail/main.conf` one may override it to any command of choice - for example your favourite editor. I figured this would be the most "standards" compliant way to add such functionality. Let me know if it works for you. No rush :) If you think nmail would still benefit from URL navigation "in app" please re-open this issue, or report a new one, and I'll consider it again. Thanks!
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#10
No description provided.