Skip to content

Closed local terminals leave zombie shells, and two Tauri plugins are registered for nothing #153

Open

Description

@Sadykhzadeh

Tested against main (894ea12).

Closed local terminals leave their shell behind

LocalTerminals::remove and clear (desktop/src-tauri/src/state.rs:309-327) drop the LocalTerminal, and with it the portable-pty child. In portable-pty 0.9 that is a plain std::process::Child, which neither kills nor waits when dropped. Dropping the PTY master hangs up the tty, so a typical shell exits. Nothing ever collects its exit status, though, so every closed local tab leaves a zombie process until the app quits. A shell that ignores SIGHUP keeps running.

The unit tests in state.rs call child.kill() by hand after every remove, which is the step production code never takes.

Two plugins nothing uses

tauri-plugin-os and tauri-plugin-process are registered in main.rs:124-125, and os:default is granted in capabilities/default.json. No frontend code imports @tauri-apps/plugin-os or @tauri-apps/plugin-process, or invokes plugin:os|… / plugin:process|…. Restarts go through AppHandle::request_restart. The two plugins only add code to the binary, and they let the page read hostname, locale and OS version for nothing. #123 drops the os:default grant; this removes the plugins themselves.

Also noticed, not changed here

SftpManager::read_file, write_file and stat have no callers. read_file loads a whole remote file into memory. They sit in code #140 rewrites, so removing them belongs after that lands.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions