message: Fix the tab title part of the Terminal Title extension
diff: *
  * This source code is licensed under the MIT license which is detailed in the LICENSE.txt file.
  */
  -import { ExtensionContext, Logger, Terminal, TerminalBorderWidget, TabTitleWidget, TerminalEnvironment, SessionSettingsEditorBase } from '@extraterm/extraterm-extension-api';
  -import { NodeWidget } from '@nodegui/nodegui';
  +import { ExtensionContext, Logger, Terminal, TerminalBorderWidget, TerminalEnvironment, SessionSettingsEditorBase } from '@extraterm/extraterm-extension-api';
  +import { NodeWidget, QLabel, QSizePolicyPolicy, TextFormat } from '@nodegui/nodegui';
  +import { Label } from 'qt-construct';
  // import { TerminalTitleEditorWidget} from "./TerminalTitleEditorWidget";
  import { IconFormatter } from './IconFormatter';
  import { TemplateString } from './TemplateString';
  +import { TerminalEnvironmentFormatter } from './TerminalEnvironmentFormatter';
  // import { TerminalEnvironmentFormatter } from './TerminalEnvironmentFormatter';
  import { createTerminalTitleSessionSettings, Settings } from './TerminalTitleSessionSettings';
  @@ -24,7 +26,7 @@ const terminalToTemplateMap = new WeakMap<Terminal, TabTitleData>();
  export function activate(context: ExtensionContext): any {
  log = context.logger;
  // context.commands.registerCommand("terminal-title:editTitle", commandEditTitle.bind(null, context));
  - // context.registerTabTitleWidget("title", tabTitleWidgetFactory);
  + context.windows.registerTabTitleWidget("title", tabTitleWidgetFactory);
  // context.registerTerminalBorderWidget("edit-title", terminalBorderWidgetFactory.bind(null, context));
  context.sessions.registerSessionSettingsEditor("title",
  (sessionSettingsEditorBase: SessionSettingsEditorBase): NodeWidget<any> => {
  @@ -38,8 +40,8 @@ function commandEditTitle(context: ExtensionContext): void {
  context.activeTerminal.openTerminalBorderWidget("edit-title");
  terminalTitleEditorWidget.focus();
  }
  -
  -function tabTitleWidgetFactory(terminal: Terminal, widget: TabTitleWidget): any {
  +*/
  +function tabTitleWidgetFactory(terminal: Terminal): QLabel {
  const templateString = new TemplateString();
  templateString.addFormatter("term", new TerminalEnvironmentFormatter("term", terminal.environment));
  templateString.addFormatter("extraterm", new TerminalEnvironmentFormatter("extraterm", terminal.environment));
  @@ -49,22 +51,29 @@ function tabTitleWidgetFactory(terminal: Terminal, widget: TabTitleWidget): any
  const template = settings?.template ?? "${icon:fas fa-keyboard} ${" + TerminalEnvironment.TERM_TITLE + "}";
  templateString.setTemplateString(template);
  - const newDiv = document.createElement("div");
  - newDiv.classList.add("tab_title");
  - widget.getContainerElement().appendChild(newDiv);
  + const widget = Label({
  + sizePolicy: {
  + horizontal: QSizePolicyPolicy.Expanding,
  + vertical: QSizePolicyPolicy.Fixed,
  + },
  + textFormat: TextFormat.RichText,
  + text: ""
  + });
  - const boundUpdateTitleFunc = updateTitleFunc.bind(null, newDiv, templateString);
  + const boundUpdateTitleFunc = updateTitleFunc.bind(null, widget, templateString);
  terminal.environment.onChange(boundUpdateTitleFunc);
  - updateTitleFunc(newDiv, templateString);
  + updateTitleFunc(widget, templateString);
  terminalToTemplateMap.set(terminal, { templateString, updateTitleFunc: boundUpdateTitleFunc });
  - return null;
  + return widget;
  }
  -function updateTitleFunc(newDiv: HTMLDivElement, templateString: TemplateString): void {
  - newDiv.innerHTML = templateString.formatHtml();
  +function updateTitleFunc(widget: QLabel, templateString: TemplateString): void {
  + log.debug(`updateTitleFunc() ${templateString.formatHtml()}`);
  + widget.setText(templateString.formatHtml());
  + // widget.updateGeometry();
  }
  -
  +/*
  function terminalBorderWidgetFactory(context: ExtensionContext, terminal: Terminal, widget: TerminalBorderWidget): any {
  const tabTitleData = terminalToTemplateMap.get(terminal);
  return new TerminalTitleEditorWidget(context, terminal, widget, tabTitleData.templateString,
  