aws / aws/session-manager-plugin

Exit codes are not reported

Open
#59 12 comments 11 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
320
Forks
97
PR merge metrics
No merged PRs in 30d

Description

Sessions opened with the session manager plugin always report an exit code of zero even when the last executed command within the session returns a non-zero value. For example:

```
$ aws ssm start-session --target [ec2 instance]
Starting session with SessionId: [name]-0ac90007f8af508b9
$ exit 1
Exiting session with sessionId: [name]-0ac90007f8af508b9.

$ echo $?
0
```

Compare this to SSH where the exit code is carried over:

```
$ ssh [host]
[host]:~$ exit 1
logout
Connection to [host] closed.

$ echo $?
1
```

Not reporting the exit code makes scripting extremely difficult since there's no way to tell if a given command was successful or not. Reporting the exit code of the last command run in the session would be more inline with other standard tools.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.