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

Search alias inconsistent/being consumed #4962

Open
Zerogaku opened this issue Apr 8, 2024 · 5 comments
Open

Search alias inconsistent/being consumed #4962

Zerogaku opened this issue Apr 8, 2024 · 5 comments

Comments

@Zerogaku
Copy link

Zerogaku commented Apr 8, 2024

I'm not sure How to replicate this consistently but I noticed this happening way too often.

When using a search alias for example yt (for youtube search) the alias and the search query gets consumed by google, so it ends up typing "yt linux" in google search for example.

@bovine3dom
Copy link
Member

Could you post your config? I have never heard of this issue before so I'm wondering if yours has got corrupted somehow. Thanks!

@Zerogaku
Copy link
Author

Zerogaku commented Apr 9, 2024

here it is:

# to read on startup use:
# autocmd DocStart .* source ~/.config/tridactyl/tridactylrc
# if on windows use:
# autocmd DocStart .* source C:\User\Null\Appdata\Roaming\tridactyl\tridactyrc
# NOTE: on windows place themes folder in directory containing the tridactylrc

# also for conveniency sake, to get tridactyl running on sites protected my firefox,
# remove urls from extensions.webextensions.restrictedDomains in about:config
# and set privacy.resistFingerprinting.block_mozAddonManager to true

# Personal theme
colorscheme custom
# set editorcmd $TERMINAL -n tridactyl -e nvim
# fix for tridactyl edit freezing https://github.com/tridactyl/tridactyl/issues/4771
alias editor_xclip composite js document.activeElement.addEventListener('focusin', e => { if(e.target.classList.contains('TridactylEditing')) tri.native.run('xclip -sel clip -o').then(c => tri.excmds.yank(c.content.slice(0, -1))) }, {'once': true}) | editor
bind --mode=insert <C-i> editor_xclip
bind --mode=input <C-i> editor_xclip

# Sane defaults
set smoothscroll false
set modeindicatorshowkeys true
jsb Object.keys(tri.config.get("searchurls")).reduce((prev, u) => prev.then(_ => tri.config.set("searchurls", u, null)), Promise.resolve())
set relatedopenpos next
bind J tabnext
bind K tabprev
set hintdelay 100

# Custom search urls
# youtube
set searchurls.yt https://www.youtube.com/results?search_query=%s
# arch linux wiki
set searchurls.aw https://wiki.archlinux.org/index.php?title=Special%3ASearch&search=%s
# wikipedia
set searchurls.wk https://en.wikipedia.org/w/index.php?title=Special:Search&search=%s
# pinterest
set searchurls.pt https://www.pinterest.es/search/pins/?q=%s
# github
set searchurls.gh https://github.com/search?utf8=✓&q=%s
# gentoo
set searchurls.gtw https://wiki.gentoo.org/index.php?title=Special%3ASearch&profile=default&fulltext=Search&search=%s

bindurl ^https://github.com gi hint -Vc .AppHeader-searchButton

# global marks for quick tab switching
bind <A-\> gobble 1 markaddglobal
bind \ gobble 1 markjumpglobal

# rebind tab for selecting command results
bind --mode=ex <C-j> ex.next_completion
bind --mode=ex <C-k> ex.prev_completion

# close all other tabs binding

bind gx* tabonly

# Multiwindow bindings
bind gd tabdetach
bind gD composite tabduplicate; tabdetach

@bovine3dom
Copy link
Member

This line here

jsb Object.keys(tri.config.get("searchurls")).reduce((prev, u) => prev.then(_ => tri.config.set("searchurls", u, null)), Promise.resolve())

is probably the culprit. Firefox storage has lots of race conditions that cause very strange behaviour.

I'd recommend removing that line from your RC, wiping your Tridactyl settings with :sanitise tridactyllocal, running that line manually in Tridactyl once and then restarting Tridactyl.

@Zerogaku
Copy link
Author

Zerogaku commented Apr 10, 2024

Thanks I'll do that and see if it makes any difference!

Also wouldn't it be best to not have default aliases to begin with? Or at least not without a prefix of some sort in case the user wishes to actually search for topics related the the search alias name?

@bovine3dom
Copy link
Member

You're probably right, we do have a lot of them. Initially it was because they weren't user-configurable, but that reason is about 6 years out of date. I'll try to get some more feedback and see what people think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants