MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / parseCursorForwardN

Function parseCursorForwardN

cmd/wsh/cmd/wshcmd-debugterm.go:169–182  ·  view source on GitHub ↗
(seq []byte)

Source from the content-addressed store, hash-verified

167}
168
169func parseCursorForwardN(seq []byte) (int, bool) {
170 if len(seq) < 3 || seq[len(seq)-1] != 'C' {
171 return 0, false
172 }
173 params := string(seq[2 : len(seq)-1])
174 if params == "" {
175 return 1, true
176 }
177 n, err := strconv.Atoi(params)
178 if err != nil || n <= 0 {
179 return 0, false
180 }
181 return n, true
182}
183
184// splitOnCRLFRuns splits s at the end of each run of \r and \n characters.
185// Each segment includes its trailing CR/LF run. The last segment may have no such run.

Callers 1

formatDebugTermDecodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected