Pick the folder a tab works in
The Folder box in the new-thread form is a typeable list of your repos that also completes any path on the machine, and shows the rest of the best match in grey as you type. What you pick is the directory the agent runs in.
Why you would use it
Every tab is rooted in one directory: the agent starts there, the
file explorer shows it,
shell mode opens there, and the
resume screen searches it
under This folder. On a phone you
cannot type /home/you/git/some-repo comfortably, so the box ranks your repos by
a few letters and completes real paths from the disk when you type one.
How to use it
- Tap the folder box (
.new-cwd) in the new-thread card (#newthread) or in the Threads sheet's NEW THREAD section. - Type a few letters of the repo's name. The menu (
.new-cwd-menu), joined to the bottom of the box, narrows as you type. When the top row's path carries on from what you typed, the rest of it shows in grey after the caret.
3. Press Tab, or tap the Tab chip at the right of the box (.cwdfill), to
put the marked row in whole. Press it again to put the next row in, as a
terminal cycles its completions; the list stays as it was, and wraps at the
end. Shift+Tab steps back. Type a letter to narrow the list again. Tap the row you want, or press Enter to
take the marked row and start the thread at once. On a keyboard, ArrowDown and
ArrowUp move the mark through the list, wrapping at the ends; the grey text
follows the marked row.
4. Backspace deletes from the end, as in a terminal, so deleting the folder's
name leaves its parent, and the list shows what else is there.
5. To use a folder that is not a repo under ~/git, type a path: anything
starting with /, ~ or ., or containing a /. The box asks the server
for the children of that directory and lists them.
6. To walk the folders instead, tap the folder button (.cwd-browse) at the right end of the Folder label line. See
set-a-default-folder.

What you see
The box sits on its own line under the label Folder. Its placeholder is
folder, and it is seeded with the current tab's folder as a ~-short label:
the parent typed and the folder's name in grey after the caret. Start thread
and Enter take the seeded folder as it is; Tab or the chip shows it whole. The
grey text hides when the path is too long for the box, and the chip hides when
there is nothing to put in and no other row to step to. The row of the folder you already have is marked. Once you
start typing a filter, the top row is marked instead, unless the arrow keys moved
the mark; the marked row is the one Enter, Tab and Start thread take. It has a blue bar on its
left and a blue tint, and its name is bold.
The list hangs off the bottom of the box as one panel, one folder per line.
Each row shows a folder icon, the folder's ~-short label and, for a repo, its
current branch on the right. A folder found by path completion that is not a repo shows no
branch.
The list of repos is re-read from the server every time the card opens, so a worktree you created a minute ago is there.
In the VCode app the list and the path completion are the picked box's: the box
pick (.new-box) comes first in the row, and picking another box refills an
untouched folder box with that box's folder and re-reads its list. A folder you
typed stays, and belongs to the box picked while you typed it: Start on another
box refuses it with that folder is on <box>, not <box>: pick it again. See
work-on-several-boxes.
Options and settings
| Option | Default | What it changes |
|---|---|---|
| typed text | empty | Under ~ the whole word is a filter over the known repos; a text that looks like a path (/, ~, . or containing /) also completes against the disk |
| completion debounce | 150 ms after the last keystroke (COMPLETE_DEBOUNCE_MS in public/app.js) |
How long typing pauses before the disk is read |
| completion limit | 40 entries | How many children of a directory come back |
Limits and known gaps
- The repo list is the directories directly under
~/gitthat are git repositories, plus~/gititself. A box with no~/gitlists its home folder and the repos directly in it. Nothing else is listed until you type a path. New threads start in the home folder unless you set another default. - Path completion lists directories and symlinks to directories only. Dotted names stay hidden until what you typed starts with a dot.
- A directory that is missing or unreadable gives an empty menu, not an error.
- A typed path only gives way to a known folder it is the start of, so a new directory is never swapped for a repo whose letters happen to scatter through what you typed.
- The grey text follows the top row only when that row's path starts with what you typed, letter for letter and in the same case. A match on scattered letters shows no grey text; tap its row instead.
Related
- start-a-thread: the form the box lives in
- set-a-default-folder: browsing for a folder and making it the default
- work-on-several-boxes: which box's folders the app lists
- new-tab-command: the same picker in the composer
- thread-working-folder: moving an existing tab
- file-explorer: what the picked folder shows