mirror of
https://github.com/weaveworks/scope.git
synced 2026-05-09 02:36:52 +00:00
``` $ gvt delete github.com/Azure/go-ansiterm $ gvt fetch --revision d6e3b3328b783f23731bc4d058875b0371ff8109 github.com/Azure/go-ansiterm 2018/07/23 15:45:10 Fetching: github.com/Azure/go-ansiterm ```
32 lines
620 B
Go
32 lines
620 B
Go
package ansiterm
|
|
|
|
type oscStringState struct {
|
|
baseState
|
|
}
|
|
|
|
func (oscState oscStringState) Handle(b byte) (s state, e error) {
|
|
oscState.parser.logf("OscString::Handle %#x", b)
|
|
nextState, err := oscState.baseState.Handle(b)
|
|
if nextState != nil || err != nil {
|
|
return nextState, err
|
|
}
|
|
|
|
switch {
|
|
case isOscStringTerminator(b):
|
|
return oscState.parser.ground, nil
|
|
}
|
|
|
|
return oscState, nil
|
|
}
|
|
|
|
// See below for OSC string terminators for linux
|
|
// http://man7.org/linux/man-pages/man4/console_codes.4.html
|
|
func isOscStringTerminator(b byte) bool {
|
|
|
|
if b == ANSI_BEL || b == 0x5C {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|