Skip to content

Add toggle to disable file path injection into terminal after upload #66

Description

@physercoe

Summary

After an SFTP file upload via the terminal screen, _injectFilePaths in terminal_screen.dart:4600 automatically types the remote file path into the active tmux pane via send-keys. This is the "path injection" feature — intended to let the user immediately use the uploaded file path in shell commands.

However, there is no way to disable this behavior entirely. The current settings only control:

  • filePathFormat (default {path}) — the template for the injected text
  • fileAutoEnter (default false) — whether to press Enter after injection
  • fileBracketedPaste (default false) — whether to use bracketed paste

All three assume injection is desired. A user who just wants to upload a file to the remote host without the filename appearing as keystrokes in their terminal has no option.

Proposed fix

Add a fileInjectPath boolean setting (default true for backward compatibility). When false, _injectFilePaths and _injectImagePath skip the send-keys/sshClient.write call entirely and only do the SFTP upload.

The FileTransferConfirmDialog and ImageTransferConfirmDialog should expose this toggle.

Related code

  • lib/screens/terminal/terminal_screen.dart:4600_injectFilePaths
  • lib/screens/terminal/terminal_screen.dart:4506_injectImagePath
  • lib/widgets/file_transfer_confirm_dialog.dart — file upload options dialog
  • lib/widgets/image_transfer_confirm_dialog.dart — image upload options dialog
  • lib/providers/settings_provider.dart — settings definitions

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions