summaryrefslogtreecommitdiff
path: root/vendor/github.com/Azure/go-ansiterm/osc_string_state.go
blob: 194d5e9c94d30877b24cc15e82bfe81b85cb4259 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
	}

	// There are several control characters and sequences which can
	// terminate an OSC string. Most of them are handled by the baseState
	// handler. The ANSI_BEL character is a special case which behaves as a
	// terminator only for an OSC string.
	if b == ANSI_BEL {
		return oscState.parser.ground, nil
	}

	return oscState, nil
}