From 6e3000fc4bf1d07830c772372fb101ba1ce73c42 Mon Sep 17 00:00:00 2001 From: patrick Date: Wed, 22 May 2024 10:42:46 +0200 Subject: [PATCH] Version 1.01 --- octave.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/octave.c b/octave.c index cb74fc6..38babf4 100644 --- a/octave.c +++ b/octave.c @@ -683,20 +683,20 @@ void pr_encours(void) void * fct_com(void * p) { int REQ=1; -char *cmd = NULL, *fauth, com[100]; +char *cmd = NULL, *fauth, pr[30], com[200]; int n2; pid_t pid; fauth = (char*)p; pid = getpid(); read_history(FHISTO); - if (REPR) comsh("reset",0); while (REQ) { if (kill(pid,SIGUSR1) < 0) { /* verif processus acquisition */ ENDT=1; write(p1[1],"\n",1); } free(cmd); - cmd = readline("O-> "); + sprintf(pr,"\e[01;34m%s-> \e[00m",NPROG); + cmd = readline(pr); if ((n2 = strlen(cmd)) > 0) { write(p1[1],"\n",1); add_history(cmd); @@ -887,6 +887,8 @@ pid_t pid; } WH=write_history(FHISTO); free(cmd); + sprintf(com,"rm -f .Trav%d",pid); + comsh(com,0); /* fin dialogue */ pthread_exit(NULL); } @@ -1169,15 +1171,18 @@ int Inter=0, i, ie, np=0, opt; close(p1[1]); closelog(); if (ENDT) { /* relance auto */ - comsh("reset",0); if (T1) printf("Relance auto %s dans %d sec. ...\n",strPID, DELAYR); sleep(DELAYR); /* attend N s */ NP = (char**)malloc((sizeof(Pars))*(N+3)); - for (i=0;i