@@ -68,48 +68,48 @@ func startSession(ctx context.Context, launch *sessionLaunch, term *libghostty.T
6868}
6969
7070func newSession (ctx context.Context , wasmRT * libghostty.Runtime , resizePolicy config.ResizePolicy , spec sessionStartSpec ) (* Session , error ) {
71- term , err := wasmRT .NewTerminal (ctx , uint32 (spec .size .cols ), uint32 (spec .size .rows ), spec .scrollback )
71+ term , err := wasmRT .NewTerminal (uint32 (spec .size .cols ), uint32 (spec .size .rows ), spec .scrollback )
7272 if err != nil {
7373 return nil , err
7474 }
7575
7676 launch , err := launchSessionProcess (spec )
7777 if err != nil {
78- term .Close (ctx )
78+ term .Close ()
7979 return nil , err
8080 }
8181
8282 return startSession (ctx , launch , term , resizePolicy , spec ), nil
8383}
8484
8585func restoreSession (ctx context.Context , wasmRT * libghostty.Runtime , state * sessionState , resizePolicy config.ResizePolicy , spec sessionStartSpec ) (* Session , error ) {
86- term , err := wasmRT .NewTerminal (ctx , uint32 (state .Cols ), uint32 (state .Rows ), spec .scrollback )
86+ term , err := wasmRT .NewTerminal (uint32 (state .Cols ), uint32 (state .Rows ), spec .scrollback )
8787 if err != nil {
8888 return nil , err
8989 }
9090
9191 cleanup := true
9292 defer func () {
9393 if cleanup {
94- term .Close (ctx )
94+ term .Close ()
9595 }
9696 }()
9797
9898 if len (state .VT ) > 0 {
99- if err := term .Feed (ctx , state .VT ); err != nil {
99+ if err := term .Feed (state .VT ); err != nil {
100100 return nil , err
101101 }
102102 }
103103 if state .IsAltScreen {
104- if err := term .Feed (ctx , []byte ("\x1b [?1049l" )); err != nil {
104+ if err := term .Feed ([]byte ("\x1b [?1049l" )); err != nil {
105105 return nil , err
106106 }
107107 }
108- if err := term .Feed (ctx , []byte ("\x1b [!p" )); err != nil {
108+ if err := term .Feed ([]byte ("\x1b [!p" )); err != nil {
109109 return nil , err
110110 }
111111 if state .Cols != spec .size .cols || state .Rows != spec .size .rows {
112- if err := term .Resize (ctx , uint32 (spec .size .cols ), uint32 (spec .size .rows )); err != nil {
112+ if err := term .Resize (uint32 (spec .size .cols ), uint32 (spec .size .rows )); err != nil {
113113 slog .Warn ("wasm resize on restore" , "session" , spec .name , "err" , err )
114114 }
115115 }
@@ -125,7 +125,7 @@ func restoreSession(ctx context.Context, wasmRT *libghostty.Runtime, state *sess
125125
126126func (s * Session ) feedLoop (ctx context.Context ) {
127127 for item := range s .feedCh {
128- if err := s .term .Feed (ctx , * item .data ); err != nil {
128+ if err := s .term .Feed (* item .data ); err != nil {
129129 slog .Debug ("wasm feed error" , "session" , s .Name , "err" , err )
130130 }
131131 s .feedApplied .Store (item .seq )
@@ -240,7 +240,7 @@ func (s *Session) run() {
240240 // Attach dumps must reflect every PTY chunk we've already accepted.
241241 s .waitFeedApplied (nextFeedSeq )
242242
243- dump , err := s .term .DumpScreen (s . ctx , libghostty .DumpVTFull )
243+ dump , err := s .term .DumpScreen (libghostty .DumpVTFull )
244244 if err != nil {
245245 a .result <- attachResp {err : err }
246246 continue
@@ -363,7 +363,7 @@ func (s *Session) close(ctx context.Context) {
363363 _ = syscall .Kill (- int (s .PID ), syscall .SIGKILL )
364364 <- s .done
365365 }
366- s .term .Close (ctx )
366+ s .term .Close ()
367367 if s .tempDir != "" {
368368 os .RemoveAll (s .tempDir )
369369 }
@@ -379,7 +379,7 @@ func (s *Session) sendInput(data []byte) error {
379379}
380380
381381func (s * Session ) dumpScreen (ctx context.Context , format libghostty.DumpFormat ) (* libghostty.ScreenDump , error ) {
382- return s .term .DumpScreen (ctx , format )
382+ return s .term .DumpScreen (format )
383383}
384384
385385func exitCodeFromWaitStatus (ws syscall.WaitStatus ) int32 {
0 commit comments