sessionInitLine method

  1. @override
String sessionInitLine(
  1. CwdMarker marker
)
override

initLine with the prompt made CwdMarker.promptSentinel — written as two concatenated halves, so the echo of this very line does not contain it. The client then strips the prompt, and the echoed line after it, by that exact string.

Implementation

@override
String sessionInitLine(CwdMarker marker) {
  final sentinel = marker.promptSentinel;
  final mid = sentinel.length ~/ 2;
  return "function prompt { '${sentinel.substring(0, mid)}'+"
      "'${sentinel.substring(mid)}' }; "
      r"$ErrorActionPreference='Continue'";
}