Title
[File Manager] Delete fails silently on Windows hosts — rm -f not supported by PowerShell
Platform
App - Windows
Server Installation Method
Proxmox (Community Scripts)
Version
2.3.1
Troubleshooting
The Problem
Description
When using the Termix file manager to delete a file on a Windows Server host (OpenSSH), clicking "Delete" and confirming shows no error message — the operation silently fails and the file remains.
Investigation of file-manager.js reveals that the delete operation executes the following shell command over SSH:
rm -f '<path>' && echo "SUCCESS"
This command is Linux-specific. On Windows, PowerShell's rm alias maps to Remove-Item but does not support the -f flag in the same way, and single-quoted Windows paths with backslashes are not handled correctly in non-interactive SSH sessions. The command fails silently — no Permission denied is returned, so Termix never logs an error.
Steps to reproduce
- Add a Windows Server host in Termix (OpenSSH enabled)
- Open the File Manager on that host
- Right-click a file → Delete → Confirm
- Observe: popup "Failed to delete" appears, file is not deleted, no error in Termix logs
Expected behavior
File is deleted successfully, or an explicit error message is shown explaining the incompatibility.
Observed behavior
Silent failure. Termix logs show file_delete event but no file_delete_success or error event follows. The rm -f command is sent but returns no output the backend can interpret as success.
Root cause
In backend/ssh/file-manager.js, the delete command is hardcoded as:
const deleteCommand = isDirectory
? `rm -rf '${escapedPath}'`
: `rm -f '${escapedPath}'`;
These are POSIX commands. On Windows hosts, a PowerShell-compatible equivalent should be used, e.g.:
Remove-Item -Force -Path '<path>' or cmd /c del /f "<path>"
Suggested fix
Detect the remote OS before building the delete command (e.g. using a previous uname / ver probe, or a flag stored on the host record), then branch the command accordingly:
- Linux/macOS → current
rm -f behaviour (no change)
- Windows →
Remove-Item -Force -LiteralPath '<path>'
Environment
- Termix version: latest self-hosted (LXC container, Debian)
- Remote host OS: Windows Server (OpenSSH for Windows)
- SSH subsystem:
sftp-server.exe
- Browser: web interface
Acceptance criteria
How to Reproduce
Steps to reproduce
- Add a Windows Server host in Termix (OpenSSH enabled)
- Open the File Manager on that host
- Right-click a file → Delete → Confirm
- Observe: popup "Failed to delete" appears, file is not deleted, no error in Termix logs
Additional Context
No response
Title
[File Manager] Delete fails silently on Windows hosts — rm -f not supported by PowerShell
Platform
App - Windows
Server Installation Method
Proxmox (Community Scripts)
Version
2.3.1
Troubleshooting
The Problem
Description
When using the Termix file manager to delete a file on a Windows Server host (OpenSSH), clicking "Delete" and confirming shows no error message — the operation silently fails and the file remains.
Investigation of
file-manager.jsreveals that the delete operation executes the following shell command over SSH:This command is Linux-specific. On Windows, PowerShell's
rmalias maps toRemove-Itembut does not support the-fflag in the same way, and single-quoted Windows paths with backslashes are not handled correctly in non-interactive SSH sessions. The command fails silently — noPermission deniedis returned, so Termix never logs an error.Steps to reproduce
Expected behavior
File is deleted successfully, or an explicit error message is shown explaining the incompatibility.
Observed behavior
Silent failure. Termix logs show
file_deleteevent but nofile_delete_successor error event follows. Therm -fcommand is sent but returns no output the backend can interpret as success.Root cause
In
backend/ssh/file-manager.js, the delete command is hardcoded as:These are POSIX commands. On Windows hosts, a PowerShell-compatible equivalent should be used, e.g.:
Remove-Item -Force -Path '<path>'orcmd /c del /f "<path>"Suggested fix
Detect the remote OS before building the delete command (e.g. using a previous
uname/verprobe, or a flag stored on the host record), then branch the command accordingly:rm -fbehaviour (no change)Remove-Item -Force -LiteralPath '<path>'Environment
sftp-server.exeAcceptance criteria
How to Reproduce
Steps to reproduce
Additional Context
No response