Shell state is private but it would be useful to add an accessor for use in a when statement (as shown in the docs).