@@ -29,6 +29,7 @@ import (
2929	"strconv" 
3030	"strings" 
3131	"sync" 
32+ 	"sync/atomic" 
3233	"syscall" 
3334	"time" 
3435
@@ -336,9 +337,10 @@ func Run(options ...RunOption) {
336337		}
337338	}
338339
340+ 	terminalNoDeadlineExceeded  :=  watchTerminalNoDeadlineExceeded (ctx , exps , host )
339341	willShutdownCtx , fireWillShutdown  :=  context .WithCancel (ctx )
340342	termMux  :=  terminal .NewMux ()
341- 	termMuxSrv  :=  terminal .NewMuxTerminalService (termMux )
343+ 	termMuxSrv  :=  terminal .NewMuxTerminalService (termMux ,  terminalNoDeadlineExceeded )
342344	termMuxSrv .DefaultWorkdir  =  cfg .RepoRoot 
343345	if  cfg .WorkspaceRoot  !=  ""  {
344346		termMuxSrv .DefaultWorkdirProvider  =  func () string  {
@@ -582,6 +584,36 @@ func getIDENotReadyShutdownDuration(ctx context.Context, exps experiments.Client
582584	}
583585}
584586
587+ func  watchTerminalNoDeadlineExceeded (ctx  context.Context , exps  experiments.Client , gitpodHost  string ) * atomic.Bool  {
588+ 	newBool  :=  func (v  bool ) * atomic.Bool  {
589+ 		r  :=  atomic.Bool {}
590+ 		r .Store (v )
591+ 		return  & r 
592+ 	}
593+ 	if  exps  ==  nil  {
594+ 		return  newBool (false )
595+ 	}
596+ 
597+ 	value  :=  exps .GetBoolValue (ctx , "supervisor_terminal_no_deadline_exceeded" , false , experiments.Attributes {GitpodHost : gitpodHost })
598+ 	result  :=  newBool (value )
599+ 
600+ 	go  (func () {
601+ 		t  :=  time .NewTicker (30  *  time .Second )
602+ 
603+ 		for  {
604+ 			select  {
605+ 			case  <- ctx .Done ():
606+ 				return 
607+ 			case  <- t .C :
608+ 				value  :=  exps .GetBoolValue (ctx , "supervisor_terminal_no_deadline_exceeded" , false , experiments.Attributes {GitpodHost : gitpodHost })
609+ 				result .Store (value )
610+ 			}
611+ 		}
612+ 	})()
613+ 
614+ 	return  result 
615+ }
616+ 
585617func  isShallowRepository (rootDir  string ) bool  {
586618	cmd  :=  runAsGitpodUser (exec .Command ("git" , "rev-parse" , "--is-shallow-repository" ))
587619	cmd .Dir  =  rootDir 
0 commit comments