Skip to content

Executing a shell command non-interactively is no longer working if interactive mode is enabled in version 4.0.0 #1278

@mhdstg

Description

@mhdstg

I have created a shell application with Spring Boot. In the application.yaml I have enabled interactive mode and script execution:

spring:
  application:
    name: AMELIOShell
  shell:
    history:
      name: "amelioshell.log"
    interactive:
      enabled: true
    script:
      enabled: true

With version Spring Shell 3.4 I could execute the shell non interactively by simply passing a command, e.g.:

java -jar .\amelioshell-5.3.0-SNAPSHOT.jar get-jobstate

The output of the command is displayed, and then the shell exits.

When I run the same command with a jar that was built with version 4.0 the shell starts interactively, and it stops at the prompt. If I add the parameter --spring.shell.interactive.enabled=false then the shell is executed non-interactively.

This is a valid bypass for me, but the previous behaviour was much better.

Is ist possible to find out at runtime whether a command was executed interactively or non interactively?

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/need-triageTeam needs to triage and take a first look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions