(logCtx context.Context, blockId string)
| 1539 | } |
| 1540 | |
| 1541 | func resetTerminalState(logCtx context.Context, blockId string) { |
| 1542 | if blockId == "" { |
| 1543 | return |
| 1544 | } |
| 1545 | ctx, cancelFn := context.WithTimeout(context.Background(), DefaultTimeout) |
| 1546 | defer cancelFn() |
| 1547 | if isFileEmpty(ctx, blockId) { |
| 1548 | return |
| 1549 | } |
| 1550 | blocklogger.Debugf(logCtx, "[conndebug] resetTerminalState: resetting terminal state for block\n") |
| 1551 | resetSeq := shellutil.GetTerminalResetSeq() |
| 1552 | resetSeq += "\r\n" |
| 1553 | err := doWFSAppend(ctx, waveobj.MakeORef(waveobj.OType_Block, blockId), JobOutputFileName, []byte(resetSeq)) |
| 1554 | if err != nil { |
| 1555 | log.Printf("error appending terminal reset to block file: %v\n", err) |
| 1556 | } |
| 1557 | } |
| 1558 | |
| 1559 | func isFileEmpty(ctx context.Context, blockId string) bool { |
| 1560 | if blockId == "" { |
no test coverage detected