tridactyl / tridactyl

A Vim-like interface for Firefox, inspired by Vimperator/Pentadactyl.
https://tridactyl.xyz
Other
5.16k stars 398 forks source link

Allow opening new tabs (via Ctrl-t) in a preset container #5004

Open nkitsaini opened 3 months ago

nkitsaini commented 3 months ago

Not to be confused with option tabopencontaineraware

Whenever I open a new tab in firefox (via Ctrl-t), it opens the "Tridactyl New Tab" without a container. Is it possible to preset a container to open all the "New Tab" in (irrespective of if they were opened via ctrl-t or :tabopen etc.)?

Ideally, firefox should have a way to define "default" container, but I think if Tridactyl New Tab provides such a functionality, it'll be good enough.

bovine3dom commented 2 months ago

I thought I had answered this, sorry for the wait.

Is :bind t fillcmdline tabopen -c [container name] a good enough workaround for you?

:bind --mode=browser <C-t> tabopen -c [container name] might work too unless Firefox blocks you from using that bind.

nkitsaini commented 2 months ago

I thought I had answered this, sorry for the wait.

No issues :)

:bind t fillcmdline tabopen -c [container name]

I have been trying to use this for past few days, but muscle memory for C-t is big.

:bind --mode=browser tabopen -c [container name]

I like this one more. It is not working out-of-the-box. But IIUC, I should be able to use some userChrome.js or autoconfig.cfg for help. If I'm able to do this, it'll solve my issue.

bovine3dom commented 2 months ago

there are two options i know of for binding to ctrl+t:

1) use xkeysnail to remap ctrl+t to something that you can bind to like ctrl+. in the firefox window, then bind to ctrl+. in tridactyl, or

2) patch firefox as described here https://github.com/glacambre/firefox-patches/issues/1#issuecomment-549145257

nkitsaini commented 2 months ago

patch firefox as described here

That was easier than expected. It solves my issue. :+1: :+1:

Currently it works without --mode=browser but doesn't work with it. Not sure if something is wrong with my setup, but not an issue for me as such.

Thanks for helping out (and maintaining tridactyl) :bow:. I still think that having a "default" container as a tridactyl setting might be better if there are no major technical or maintenance challenges.

The issue can be closed from my end.

bovine3dom commented 2 months ago

Currently it works without --mode=browser but doesn't work with it. Not sure if something is wrong with my setup, but not an issue for me as such.

The patch doesn't apply to browser wide binds although it probably could if we tried hard enough.

I'll leave the issue open for adding :set container like we have with :set proxy :)