private boolean doProcessOsc()

in core/src/com/jediterm/terminal/emulator/JediEmulator.java [254:297]


  private boolean doProcessOsc(@NotNull SystemCommandSequence args) {
    // https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands
    int ps = args.getIntAt(0, -1);
    switch (ps) {
      case 0: // Icon name / Window Title
      case 1: // Icon name
      case 2: // Window Title
        String name = args.getStringAt(1);
        if (name != null) {
          myTerminal.setWindowTitle(name);
          return true;
        }
        break;
      case 7:
        // Support for OSC 7 is pending
        // "return true" to avoid logging errors about unhandled sequences;
        return true;
      case 8: // Hyperlink https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
        String uri = args.getStringAt(2);
        if (uri != null) {
          if (!uri.isEmpty()) {
            myTerminal.setLinkUriStarted(uri);
          }
          else {
            myTerminal.setLinkUriFinished();
          }
          return true;
        }
        break;
      case 10:
      case 11:
        return processColorQuery(args);
      case 104:
        // `Ps = 104 ; c` (Reset Color Number c).
        // Let's support resetting to avoid warnings.
        // As there is no support for `Ps = 4 ; c ; spec` (Change Color Number c to the color specified by spec),
        // resetting is just no operation.
      case 1341:
        List<String> argList = args.getArgs();
        myTerminal.processCustomCommand(argList.subList(1, argList.size()));
        return true;
    }
    return false;
  }