d99kris / nchat

Terminal-based Telegram / WhatsApp client for Linux and macOS
MIT License
670 stars 47 forks source link

Can't open in message links #77

Closed Bellavene closed 1 year ago

Bellavene commented 1 year ago

Description: After update to latest version, whenever I try to open a link from a message, nchat only "blinks" and does nothing more.

How to reproduce it: Don't know

Environment:

d99kris commented 1 year ago

Hi @Bellavene - I tested here just now (also macOS 13.0.1) and I don't see the issue. Selecting a message and pressing CTRL-w opens any link(s) in the message.

Can I check what key binding you have for open_link in ~/.nchat/key.conf? You can run grep open_link ~/.nchat/key.conf in the terminal to obtain it.

Bellavene commented 1 year ago

Hello Kristofer!

Yes, It is set as supposed to be. The screen just blinks to prompt in a millisecond and nothing.

Thank you

d99kris commented 1 year ago

Could you perhaps share a copy of your ~/.nchat/key.conf? (you can just drag'n'drop into the comment field I think)

Basically I'd like to see if there is some key binding conflict.

Bellavene commented 1 year ago

Here you go. But as I sayd, I believe it is something else. key.txt

d99kris commented 1 year ago

Thank you. Yes, looks like you're right - this key.conf works fine for me.

Have you configured attachment_open_command in ~/.nchat/ui.conf? Or is it empty? (empty is the default, btw)

One more thing to check could be if there's any log warning in ~/.nchat/log.txt after you try opening a link? Nchat uses an external command to open links, and if that command fails, nchat logs something on this format:

cmd \"%s\" failed (%d)"
Bellavene commented 1 year ago

Yes, it was attachment_open_command, configured it so ranger opens and I can copy/show or whatever with the file.

in log.txt there was no errors related to this.

d99kris commented 1 year ago

Ok I see, I suppose we can add support in nchat for a separate config parameter like link_open_command, to make it more straight-forward to configure. Let me look into this.

As a temporary workaround you could create a wrapper shell script which detects if it's being passed an url or not.

Bellavene commented 1 year ago

Thank you. Would be useful if open links and open_command would be separated. But I can use a shell script as a workflow :)

Bellavene commented 1 year ago

Haha, we wrote the same things. Thank you

d99kris commented 1 year ago

Hi again, in the above commit support for configuring link open command separately has been added. The parameter is link_open_command in ~/.nchat/ui.conf. Refer to README.md for more details.