stig icon indicating copy to clipboard operation
stig copied to clipboard

Can't focus tab by title in the rcfile: No tab with matching title

Open marcelpaulo opened this issue 7 years ago • 5 comments

tab --focus <title> in the rcfile generates error No tab with matching title: <title>, no matter if the title is explicit (tab --title) or automatically generated. The command works in the TUI, though.

I have this initial rcfile:

# default tabs
tab ls --sort status,!progress all
tab ls --sort !ratio complete
tab ls --sort status,!progress incomplete
tab ls --sort !progress downloading
tab ls --sort !ratio uploading
tab ls stopped
tab --focus all

and when I run the TUI, I get this error:

No tab with matching title: 'all'

If I comment out tab --focus all and run it in the TUI, with :tab --focus all, it focuses the all tab.

marcelpaulo avatar Mar 17 '18 09:03 marcelpaulo

Thanks. Confirmed.

This one may be tricky to fix, though. I'll have to investigate.

rndusr avatar Mar 17 '18 10:03 rndusr

Of course, it can be worked around using the tab number position, in this case, tab --focus 1

marcelpaulo avatar Mar 17 '18 11:03 marcelpaulo

I was just reviewing the issues I had opened, checking if there wasn't any that needed closing, and discovered that this issue doesn't happen if I run tab --focus title from within the TUI; it only happens when tab --focus in is in the rc file.

marcelpaulo avatar Jun 30 '18 16:06 marcelpaulo

Yup. It's because everything is running asynchronoulsy.

tab ls foo opens a tab, runs ls foo in it and returns immediately while ls foo is running in the background.

After the command completed, the tab title is set to name~foo.

Before the command completed, all the titles are still unset.

This is definitely a bug, but I have no idea how to fix it.

rndusr avatar Jun 30 '18 17:06 rndusr

Thanks for the explanation !

I'd say this is a really minor bug. I ended up finding it better to focus by number.

marcelpaulo avatar Jun 30 '18 17:06 marcelpaulo