Skip to content

[Bug] attach to a non-existent session prints log if it is present #20

@greatvovan

Description

@greatvovan

The help prompt states:

attach <session> Strict attach (fail if session missing)

However in case the log is still present in the cache (e.g. session was just terminated), the program prints the log to the output before exiting with an error code.

To reproduce

$> = native shel
$ = atch shell

$> atch new session1
atch: session 'session1' created
$ exit
exit

[atch: session 'session1' exited after 6s]
$> atch list
(no sessions)
$> atch attach session1
$ exit                                               # Printed
exit                                                 # Printed
                                                     # Printed
[atch: session 'session1' ended after 6s]            # Printed
$> echo $?
1

Expected

atch attach session1 produces a descriptive error message and exits immediately.

Actual behavior

The log is printed to the output, if log is present.


UPDATE: the bug has potential to become a feature as described in #19 (case 3).

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