Repository navigation
Description
Use case
I run Claude Code and Codex in Termix terminals most of the day. Handing them a file is a constant need: a PDF spec, a log, a CSV, a zip of sample data. Pasting or dropping an image already works well for screenshots (dropping is in #90). For any other file I have to leave the terminal, open Files, pick a folder, upload, then go back and type the path by hand.
In a local terminal the same thing is one gesture: drag the file onto the window and its path appears at the prompt. I'd like Termix to do that for a remote session: drop a file on the terminal, Termix uploads it to the host and types its path, ready for the agent to read.
Proposal
Extend the image upload to files that are not images, with the same flow and the same storage code:
- A file dropped on a terminal (and, if you like, picked with the toolbar button) is uploaded over the terminal's own SSH session by SFTP, the way images are in remote mode.
- It goes to
/tmp/termix-files(~/.termix-fileson Windows hosts), next to/tmp/termix-images, with the same handling: folder 0700, files 0600, the lock, the expiry (one hour by default) and the count and size limits. - The quoted path is typed at the prompt, not submitted. Several files are typed in drop order.
- Images keep today's path unchanged, including the PNG re-encoding.
The only step skipped for other files is decoding and re-encoding, since there is nothing to decode.
Design points I'd like your view on
1. File name. Images get a random name. For other files the name and extension matter to whoever reads them, so I'd keep them: /tmp/termix-files/<random id>/<sanitised name>. The name is typed into the terminal, so it must be reduced to safe characters first (no control characters, newlines, slashes or leading dashes, and a length limit). In Claude Code or Codex a newline in typed text submits the message, so this is the point that needs the most care.
2. Storage mode. In local mode images are written on the Termix server, which is safe because they are re-encoded first. I'd allow other files only in remote SFTP mode, so nothing unconverted is stored on the Termix server. In local mode a file that is not an image keeps today's "Choose an image file" message.
3. Size. I'd start with the current 50 MB limit per upload, since it needs no change to the storage code, and point larger files to Files or rz. That covers most of what an agent is handed (specs, logs, CSVs, source archives), but not datasets, database dumps or large logs. Two questions:
- Should the limit be a setting, like the count and total size limits already are?
- Do you want a higher limit? The upload is held in memory on the backend (
multer.memoryStorage()) and the SFTP write has a 10 second timeout, so going well above 50 MB would mean streaming the upload to the host and a timeout that grows with the size. I'd do that as a follow-up once the basic flow is in.
4. Permissions. 0600 like images. 0400 (read-only) would also work if you prefer it: cleanup deletes by folder, so it is not affected.
5. Settings. Reuse the image storage settings (expiry, count, size), or add a switch to turn file uploads off. I have no strong view.
Security
- No new capability. Whoever can drop a file on a terminal already has a shell on that host, and the terminal already takes uploads through
rz. The file is written with that SSH user's rights. - The browser sends no permission bits, so the server decides the mode. Files are never executable and never readable by other users on the host.
- A folder or symlink another user created at
/tmp/termix-filesis refused by the existing checks (lstat, thenchmod 0700, which fails unless the SSH user owns it). The upload fails; nothing leaks. - The existing count, size and expiry limits bound disk use, and memory use on hosts where
/tmpis in RAM. - The upload is read into memory on the Termix backend like an image is, within the same 50 MB limit.
Why not the File Manager path
The files.sftp service writes strings, so it cannot carry binary files, and it opens a second connection per call. Using it would also make this depend on File Manager being installed. The image path already has an SFTP channel on the session, the folder checks and the limits.
Offer
If the design is acceptable I'm happy to build it and open a PR against the next dev branch, with tests for the name handling and the storage path. I'd wait for your answers on points 1, 2 and 3 before starting.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsFeature Backlog
Activity
termix-triage-bot commentedon Nov 17, 2026
Auto-triage
Extend SSH terminal file drop support to upload non-image files via SFTP and type their remote paths at the prompt.
A maintainer will take a look. If anything above looks wrong, just say so.