Skip to content

#shell syntax support #3827

Open
Open
@snikeguo

Description

@snikeguo

Is your feature request related to a problem? Please describe.
When I call shell commands, I have to use the Process class, which is troublesome.

Process process = new Process();

process.StartInfo.FileName = ...
 process.StartInfo.Arguments = ...
process.OutputDataReceived+=...
process.Start();


Describe the solution you'd like

void Main()
{
   var o="app";

   //shell line:
   var return_code= #shell gcc -o main.c $"{o}.elf";
  if(return_code==0)
 {
    #shell   echo "build ok" //echo.exe output string
    Console.WriteLine("build ok");   //C# output string
 }
   
  var dir=Console.ReadLine();

   //shell block:
  #shell 
  {
       mkdir  $"{dir}"
       cd $"{dir}"
       mkdir video //create a sub dir
  }
}

Describe alternatives you've considered
currently, there is no other available solution

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions