I installed the terminus to allow my c code to get input from the terminal. The terminus_exec works fine, but if I use terminus_open, followed by auto_close false, the shell that opens takes the input from terminal, executes the program, but then exits, so I can not see the results. terminus_exec does not have that problem because the console stays open at the bottom. What am I doing wrong. Here is my build file, and a test c program I am running.
Build file:
{
“target”: “terminus_open”,
“shell_cmd” : “gcc ${file_name} -o ${file_base_name} && ${file_path}/${file_base_name}”,
“auto_close”: “false”,
“selector” : “source.c”,
“working_dir” : “$file_path”
}
and a simple c code:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char const argv[])
{
int i, j;
fprintf(stdout, “please input an integer\n”);
fscanf(stdin, “%d”,&i),
j = ii;
printf("%d, %d\n", i, j);
char *s = “Execution Complete\n”;
printf("%s\n",s );
return 0;
}