interactive icon indicating copy to clipboard operation
interactive copied to clipboard

#shell syntax support

Open snikeguo opened this issue 1 year ago • 1 comments

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

snikeguo avatar Jan 30 '25 14:01 snikeguo

up up

snikeguo avatar Feb 03 '25 13:02 snikeguo