anvilsign in

collin/browser-terminal-extension · f93b743f

Sort hosts under the tabs, showing tab included

Collin Richards · 2026-08-19 06:46 UTC · f93b743fe962b939992a58b129fe59fea9e3abdc · parent 5974c60c · browse files

modifiedextension/sidebar.js+18 −12
⋯ 3500 unchanged lines
35013501 };
35023502
35033503 /**
3504- * What a host row's score is pushed up by, so that anything already running on
3505- * the server outranks somewhere you could connect to.
3504+ * What a host row's score is pushed up by, so that anything that already exists
3505+ * outranks somewhere you could connect to.
35063506 *
3507- * Above panes (+50) rather than below them, because a host matches on its name
3508- * — which is what you typed — where a pane matches on the prose of what Claude
3509- * happens to be doing in it.
3507+ * The bottom of the ladder — panes at +50, tabs at +60, the showing tab at
3508+ * +160, hosts here — because that is the one row in the list that is not a
3509+ * place. Everything above it is somewhere already running that you are asking
3510+ * to be taken to; a host is a connection that does not exist until the row is
3511+ * pressed, and it stays plausible for far longer while a name is being typed,
3512+ * since `bui` is a legal hostname all the way to `build`. Under a page you have
3513+ * open, then, rather than over it.
3514+ *
3515+ * The row for a host that is not in the list at all is a separate offer made
3516+ * further down, at `Infinity`, and is unaffected by this.
35103517 */
3511-const OMNI_SSH_PENALTY = 40;
3518+const OMNI_SSH_PENALTY = 200;
35123519
35133520 /** How many matches the list shows before it stops. */
35143521 const OMNI_LIMIT = 8;
⋯ 12 unchanged lines
35273534 * What a tab row's score is pushed up by, so that everything on the tmux server
35283535 * outranks a page in the browser.
35293536 *
3530- * Below the panes and the hosts, which is the bottom of the list, and it costs
3531- * the tab rows nothing they wanted: an address matches no session, window or
3532- * host name, so the query that is looking for a tab finds only tabs anyway. The
3533- * penalty decides the other case — a word that means both, a tab titled `build`
3534- * while a window is called `build` — and there the window is what the box is
3535- * for.
3537+ * Below the panes (+50) and above the hosts (+200), and it costs the tab rows
3538+ * nothing they wanted: an address matches no session, window or host name, so
3539+ * the query that is looking for a tab finds only tabs anyway. The penalty
3540+ * decides the other case — a word that means both, a tab titled `build` while a
3541+ * window is called `build` — and there the window is what the box is for.
35363542 */
35373543 const OMNI_TAB_PENALTY = 60;
35383544
⋯ 2575 unchanged lines