...

Source file src/github.com/Azure/go-ansiterm/osc_string_state.go

Documentation: github.com/Azure/go-ansiterm

     1  package ansiterm
     2  
     3  type oscStringState struct {
     4  	baseState
     5  }
     6  
     7  func (oscState oscStringState) Handle(b byte) (s state, e error) {
     8  	oscState.parser.logf("OscString::Handle %#x", b)
     9  	nextState, err := oscState.baseState.Handle(b)
    10  	if nextState != nil || err != nil {
    11  		return nextState, err
    12  	}
    13  
    14  	switch {
    15  	case isOscStringTerminator(b):
    16  		return oscState.parser.ground, nil
    17  	}
    18  
    19  	return oscState, nil
    20  }
    21  
    22  // See below for OSC string terminators for linux
    23  // http://man7.org/linux/man-pages/man4/console_codes.4.html
    24  func isOscStringTerminator(b byte) bool {
    25  
    26  	if b == ANSI_BEL || b == 0x5C {
    27  		return true
    28  	}
    29  
    30  	return false
    31  }
    32  

View as plain text