func (s *sessionRegistry) notifyWinChange(params rsession.TerminalParams, ctx *ctx) error {
	if ctx.session == nil {
		log.Debugf("notifyWinChange(): no session found!")
		return nil
	}
	sid := ctx.session.id

	// report this to the event/audit log:
	s.srv.EmitAuditEvent(events.ResizeEvent, events.EventFields{
		events.SessionEventID: sid,
		events.EventLogin:     ctx.login,
		events.EventUser:      ctx.teleportUser,
		events.TerminalSize:   params.Serialize(),
	})
	err := ctx.session.term.setWinsize(params)
	if err != nil {
		return trace.Wrap(err)
	}

	// notify all connected parties about the change in real time
	// (if they're capable)
	for _, p := range s.getParties(ctx) {
		p.onWindowChanged(&params)
	}

	go func() {
		err := s.srv.sessionServer.UpdateSession(
			rsession.UpdateRequest{ID: sid, TerminalParams: &params})
		if err != nil {
			log.Error(err)
		}
	}()
	return nil
}
// notifyWinChange is called when an SSH server receives a command notifying
// us that the terminal size has changed
notifyWinChange is called when an SSH server receives a command notifying
us that the terminal size has changed
// notifyWinChange is called when an SSH server receives a command notifying // us that the terminal size has changed
func (s *sessionRegistry) notifyWinChange(params rsession.TerminalParams, ctx *ctx) error {
	if ctx.session == nil {
		log.Debugf("notifyWinChange(): no session found!")
		return nil
	}
	sid := ctx.session.id
	s.srv.EmitAuditEvent(events.ResizeEvent, events.EventFields{
		events.SessionEventID: sid,
		events.EventLogin:     ctx.login,
		events.EventUser:      ctx.teleportUser,
		events.TerminalSize:   params.Serialize(),
	})
	err := ctx.session.term.setWinsize(params)
	if err != nil {
		return trace.Wrap(err)
	}
	for _, p := range s.getParties(ctx) {
		p.onWindowChanged(&params)
	}
	go func() {
		err := s.srv.sessionServer.UpdateSession(
			rsession.UpdateRequest{ID: sid, TerminalParams: &params})
		if err != nil {
			log.Error(err)
		}
	}()
	return nil
}
func ( s * sessionRegistry ) notifyWinChange ( params rsession . TerminalParams , ctx * ctx ) error { if ctx . session == nil { log . Debugf ( " " ) return nil } sid := ctx . session . id s . srv . EmitAuditEvent ( events . ResizeEvent , events . EventFields { events . SessionEventID : sid , events . EventLogin : ctx . login , events . EventUser : ctx . teleportUser , events . TerminalSize : params . Serialize ( ) , } ) err := ctx . session . term . setWinsize ( params ) if err != nil { return trace . Wrap ( err ) } for _ , p := range s . getParties ( ctx ) { p . onWindowChanged ( & params ) } go func ( ) { err := s . srv . sessionServer . UpdateSession ( rsession . UpdateRequest { ID : sid , TerminalParams : & params } ) if err != nil { log . Error ( err ) } } ( ) return nil }
notifyWinChange is called when an SSH server receives a command notifying
us that the terminal size has changed
notifyWinChange is called when an SSH server receives a command notifying us that the terminal size has changed
// report this to the event/audit log: // notify all connected parties about the change in real time // (if they're capable)