mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 00:47:48 +08:00

full diff:
- https://github.com/moby/term/compare/v0.5.0...v0.5.2
- d185dfc1b5...faa5f7b017
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
24 lines
624 B
Go
24 lines
624 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
|
|
}
|
|
|
|
// 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
|
|
}
|