My command execution put to the background

Context : I'm developing tests for a java program.

I have a shell script that links java code and interpret it.

In another folder, I wanted to execute this script with the Command struct, and with the currrent_dir function.

When I try my code, the shell script seems to work well, however at a moment of the execution, the execution is automatically put to the background but I don't know why.

I don't want the execution to be put to the background, would someone know how to stop this automatic behaviour ?

Here the part of my code causing the background mode activated for the Command execution :

let output = Command::new("/usr/bin/bash")
                         .current_dir("/home/admin/Desktop/work/dev")
                         .args(["-ic", ProgExeAlias])
                         .output()
                         .expect("ERROR on executing the bash alias for\
                                 executing the program.");

It seems to be related to the bash interractive mode (the -i option).

Thanks.

By "background mode", do you mean that it doesn't show stdout or allow you to input test on stdin?

I think it becomes more complicated to both collect output and display it, using spawn() (instead of output()) and manually reading from the stdio handle.