Using the workspace

The terminal

A real shell in the work pane, local or on your servers over SSH, with tabs, split, find, copy and paste, links and Send to Dus.

The Terminal tab in the work pane is a real terminal: your own shell, in the session's folder, as you'd have in VS Code. Open it with the terminal button in the top bar or Ctrl/⌘+`. Press the shortcut again while you're typing in it to go back to the chat.

It's you typing, not Dus, so nothing asks for approval. Dus runs its own commands with its bash tool, with your permission mode, approvals, sandbox and audit log. That's unchanged.

Your shell

  • It's your login shell ($SHELL, else zsh or bash; PowerShell on Windows), with your own environment.
  • It starts in the session's folder, so an isolated session's terminal is in its own worktree.
  • PORT is set to the session's preview port, so pnpm dev serves where the Preview looks.
  • It isn't sandboxed. In Full Auto, the tab says so: Full Auto's limits apply to Dus's commands, not to what you type.
  • Shells keep running while the tab is hidden and when you reload the page: they reattach with their recent output (up to 5,000 lines). They stop when you close their tab, when the session is finished or deleted, and when Duscode stops. Closing a terminal that's running something (a dev server, say) asks first and names it.

Tabs and split

  • + opens a new terminal, a profile, or a server.
  • Double-click a tab to rename it. The tab shows the folder you're in and, in red, the last command's exit code when it failed (bash and zsh).
  • Split (the split button, or Split right in the ⋯ menu) shows two terminals side by side. On a narrow screen they stack.
  • Dus's commands and Preview log sit beside your terminals: every command Dus ran in this session with its output and exit code, and the output of the session's dev server.
  • When a shell exits you see Process exited with code N and Restart.

Copy, paste and selection

Windows and Linux macOS
Copy Ctrl+Shift+C, or Ctrl+C with a selection ⌘+C
Paste Ctrl+Shift+V ⌘+V
Select all Ctrl+Shift+A ⌘+A
  • Without a selection, Ctrl+C interrupts, as always. Ctrl+D, Ctrl+R, Ctrl+L, Tab and the arrows are your shell's.
  • Pasting several lines, or a line that ends with Enter, asks first ("Paste 5 lines into the terminal?") and shows what you're pasting, so nothing runs by accident. Pastes are bracketed, so bash, zsh and vim treat them as text.
  • Double-click selects a word, triple-click a line, Alt+drag (⌥+drag on a Mac) a column.
  • Middle-click pastes your last selection. Copy on select, the font size and the default shell are in Settings → Editor & terminal; the cursor and screen reader mode are in ⋯ → Terminal settings.
  • Right-click for Copy, Paste, Select all, Send to Dus, Copy last command's output, Find, Clear, Save output… and more.
  • Ctrl/⌘+click a web address to open it, or a file:line:col such as src/app.ts:12:5 to open it in the editor tab.
  • Drop a file from the Files tree onto the terminal to type its path, quoted when it needs to be.
  • Ctrl/⌘+F finds, with next and previous, Aa (match case) and .* (regular expression).
  • Ctrl/⌘+K clears the terminal while you're in it (elsewhere it's still Search).
  • Ctrl/⌘++, − and 0 zoom. The size starts from your text size in Settings.
  • Save output… downloads what's in the terminal as a .txt file.
  • The colours follow your theme, light and dark. The bell flashes; it never beeps.
  • ⋯ → Terminal settings has copy on select, screen reader mode, the cursor style and blink.

Send to Dus, and Run in terminal

  • Send to Dus (right-click) attaches the selection, or the last command's output, to your message as a text file. Dus sees it when you send.
  • Ask Dus to look at your terminal and it can read the last lines of one, but only after you allow that read. It can never type into your terminal.
  • On a chat code block that's a command, Run in terminal puts the command at your prompt without pressing Enter. You read it, then press Enter.

Servers over SSH

+ lists your servers:

  • your deploy targets, signing in with their key from the vault
  • servers you saved
  • the Host entries in your ~/.ssh/config
  • Connect to a server…: the address, user, port and how to sign in:
    • Vault key: the key is written to a private temporary file (readable only by you) for the connection and deleted when it ends. It's never shown, logged or given to Dus.
    • ssh-agent: the keys your agent holds, or a password prompt in the terminal.
    • SSH config: a Host alias from ~/.ssh/config, with its own user, key and jump hosts.

It runs your system ssh in the terminal, so sudo and password prompts, vim, htop and tmux all work. An SSH tab is marked Remote in amber, with an amber line along the top of the terminal, so it's never mistaken for your computer.

  • Host keys. A server's key is remembered the first time you connect. If it ever changes, the connection is refused with a clear warning. Duscode never accepts a changed key. If you know why it changed (the server was rebuilt), remove the old key from the file the warning names, then reconnect.
  • Dropped connections reconnect by themselves up to three times. Otherwise press Reconnect. Keep-alives notice a dead connection within a minute.
  • For Dus's own work on a server it uses remote_run, with its approvals, not your terminal.

Profiles

+ → New profile… saves a shell and a command to start with, such as Dev server running pnpm dev. Choose it from + to open a terminal that runs it.

Services

Servers that keep running (your app's dev server, an API, a database, the preview) are the session's services. Terminal → Services, beside Dus's commands, lists each one with what it's doing, its address, Log, Restart and Stop:

  • Running · healthy: it answers its health check (its port, an address that answers, or a command that succeeds).
  • Stopped (exit code 1) · restarting in 5 s: it crashed, and Duscode starts it again after 1 s, 2 s, 5 s, 10 s, then every 30 s.
  • Keeps crashing · not restarted: it crashed 5 times in a row soon after starting. Read its Log, fix the cause (or ask Dus), then Start it.

Dus starts its own with its service tool, never with nohup … & in a command (the sandbox would end it). It is told when one dies, with the exit code and the last log lines, reads the log, fixes the cause and restarts it; it tells you in a line of the chat. A service runs in the same sandbox as Dus's commands, with no network beyond what you allowed, and its port is forwarded to your computer's localhost, so your browser and the Preview reach it.

Services stop when their session finishes, is discarded or deleted, and when Duscode stops. One Dus marks persistent (after asking you) keeps running when Duscode stops, and Duscode finds it again when it starts. Each session also keeps its own /tmp between commands.

If it says "Compatibility mode" or "Basic line mode"

Duscode uses a native terminal module, installed with prebuilt files for Windows, macOS and Linux. If it can't load on your computer:

  • Compatibility mode (Linux and macOS) runs the shell through the system's script command. Everything works except resizing.
  • Basic line mode runs the shell without a terminal. Commands work, but full-screen programs (vim, htop) and some prompts don't.

Reinstalling Duscode usually brings the native module back.

Something missing or wrong? Email support@duscode.com.