Skip to content

Implement libssh ssh_channel_get_exit_state in Channel object #73

Closed

Description

@enkore

libssh exit_status is only set by the exit-status packet/request, which is only sent for regular process exits. If the remote process exits due to a signal, an exit-signal request is sent instead, which doesn't set exit-status (which then remains at -1).

I'm halfway between
"this kinda sounds like a libssh bug, ssh_channel_get_exit_status should return the standard unixy composite, like wait(2) does"
and
"I guess we have to add a default callback for this and add a separate Channel.get_exit_signal function."

Activity

  1. added
    enhancement
    on Jul 22, 2023
  2. pkittenis commented on Oct 5, 2025

    @pkittenis
    Member

    The answer here is "neither".

    This library should not diverge from libssh implementation, whether any developers agree with that implementation or not.

    The scope of this library is to provide bindings for libssh, not to change its functionality.

    libssh provides ssh_channel_get_exit_state() for getting process exit state, including signal.

    Library should implement that function.

  3. changed the title [-]channel_signal_function for handling when request_exec process dies from signal[/-] [+]Implement libssh ssh_channel_get_exit_state in Channel object[/+] on Oct 5, 2025
  4. added and removed
    enhancement
    on Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ Proxy