55 <!-- Local Fallback Assets -->
66 < link rel ="stylesheet " href ="/static/css/xterm.css " />
77 < style >
8+ @font-face {
9+ font-family : "StandTerm Powerline Symbols" ;
10+ src : url ("/static/fonts/PowerlineSymbols.otf" ) format ("opentype" );
11+ font-display : block;
12+ font-style : normal;
13+ font-weight : 400 ;
14+ unicode-range : U+E0A0-E0A2, U+E0B0-E0B3;
15+ }
816 : root { --status-bar-height : 26px ; --tab-bar-height : 34px ; }
917 body { margin : 0 ; background : # 000 ; overflow : hidden; font-family : -apple-system, BlinkMacSystemFont, "Segoe UI" , Roboto, Helvetica, Arial, sans-serif; }
1018 # terminal-tabs { position : absolute; top : 0 ; left : 0 ; right : 0 ; height : var (--tab-bar-height ); box-sizing : border-box; background : # 151515 ; border-bottom : 1px solid # 2a2a2a ; display : none; align-items : center; gap : 4px ; padding : 4px 8px ; z-index : 40 ; overflow : hidden; }
@@ -610,6 +618,7 @@ <h3>Settings</h3>
610618 </ select >
611619 </ div >
612620 < div class ="settings-row "> < label for ="pref-fontFace "> Font face</ label > < input type ="text " id ="pref-fontFace "> </ div >
621+ < div class ="settings-row "> < label for ="pref-powerlineSymbols " title ="Use the bundled Powerline symbols font as a fallback for prompt glyphs such as the branch symbol. "> Enable Powerline symbol fallback</ label > < input type ="checkbox " id ="pref-powerlineSymbols "> </ div >
613622 < div class ="settings-row "> < label for ="pref-fontSize "> Font size</ label > < input type ="number " id ="pref-fontSize " min ="8 " max ="32 "> </ div >
614623 < div class ="settings-row "> < label for ="pref-fontWeight " title ="Heavier weights can improve perceived brightness of thin glyphs, especially with macOS grayscale antialiasing. "> Font weight</ label >
615624 < select id ="pref-fontWeight "> < option value ="normal "> Normal (400)</ option > < option value ="500 "> Medium (500)</ option > < option value ="600 "> Semibold (600)</ option > < option value ="bold "> Bold (700)</ option > </ select >
@@ -930,14 +939,15 @@ <h3>Session expired</h3>
930939 // --- Preferences ---
931940 const PREF_KEY = 'terminal.pref.v1' ;
932941 const LEGACY_DEFAULT_FONT_FACE = 'Consolas, "Courier New", monospace' ;
942+ const WINDOWS_TERMINAL_FONT_FACE = 'Consolas, "Cascadia Mono", "Courier New", monospace' ;
933943 const LEGACY_MAC_DEFAULT_FONT_FACE = 'Menlo, Monaco, "Noto Sans Mono CJK TC", "PingFang TC", "Apple LiGothic", monospace' ;
934944 const MAC_TERMINAL_FONT_FACE = 'Menlo, Monaco, "SF Mono", "Noto Sans Mono CJK TC", "Sarasa Mono TC", "Biaodian Pro Sans CNS", monospace' ;
935945 function isApplePlatform ( ) {
936946 return / M a c | i P h o n e | i P a d | i P o d / i. test ( `${ navigator . platform || '' } ${ navigator . userAgent || '' } ` ) ;
937947 }
938948 function getDefaultTerminalFontFace ( ) {
939949 if ( isApplePlatform ( ) ) return MAC_TERMINAL_FONT_FACE ;
940- return LEGACY_DEFAULT_FONT_FACE ;
950+ return WINDOWS_TERMINAL_FONT_FACE ;
941951 }
942952 const PREF_DEFAULTS = {
943953 useCustomMenu : true ,
@@ -946,6 +956,7 @@ <h3>Session expired</h3>
946956 detectUrls : true ,
947957 urlClickAction : 'overlay' ,
948958 fontFace : getDefaultTerminalFontFace ( ) ,
959+ powerlineSymbols : false ,
949960 fontSize : 14 ,
950961 // macOS grayscale antialiasing renders thin bright glyphs dimmer
951962 // than Windows ClearType, so default to a slightly heavier weight
@@ -975,6 +986,10 @@ <h3>Session expired</h3>
975986 }
976987 }
977988 function savePrefs ( p ) { localStorage . setItem ( PREF_KEY , JSON . stringify ( p ) ) ; }
989+ function getTerminalFontFace ( ) {
990+ if ( ! prefs . powerlineSymbols ) return prefs . fontFace ;
991+ return '"StandTerm Powerline Symbols", ' + prefs . fontFace ;
992+ }
978993 function normalizeFontSize ( value , fallback = PREF_DEFAULTS . fontSize ) {
979994 const text = String ( value ) . trim ( ) ;
980995 if ( ! / ^ \d + $ / . test ( text ) ) return fallback ;
@@ -2292,7 +2307,7 @@ <h3>Session expired</h3>
22922307 cursorBlink : false ,
22932308 disableStdin : true ,
22942309 cursorStyle : prefs . cursorStyle ,
2295- fontFamily : prefs . fontFace ,
2310+ fontFamily : getTerminalFontFace ( ) ,
22962311 fontSize : prefs . fontSize ,
22972312 fontWeight : prefs . fontWeight ,
22982313 scrollback : 1000 ,
@@ -3448,7 +3463,7 @@ <h3>Session expired</h3>
34483463 allowProposedApi : true ,
34493464 cursorBlink : true ,
34503465 cursorStyle : prefs . cursorStyle ,
3451- fontFamily : prefs . fontFace ,
3466+ fontFamily : getTerminalFontFace ( ) ,
34523467 fontSize : prefs . fontSize ,
34533468 fontWeight : prefs . fontWeight ,
34543469 theme : SCHEMES [ prefs . colorScheme ] || SCHEMES . vintage
@@ -3716,6 +3731,9 @@ <h3>Session expired</h3>
37163731 colorScheme : prefs . colorScheme ,
37173732 mirrorCursorStyle : state . agentTerminalMirror
37183733 ? state . agentTerminalMirror . options . cursorStyle
3734+ : null ,
3735+ mirrorFontFamily : state . agentTerminalMirror
3736+ ? state . agentTerminalMirror . options . fontFamily
37193737 : null
37203738 } ) ;
37213739 } ,
@@ -5401,6 +5419,7 @@ <h3>Session expired</h3>
54015419 document . getElementById ( 'pref-urlClickAction' ) . value = prefs . urlClickAction ;
54025420 document . getElementById ( 'pref-colorScheme' ) . value = prefs . colorScheme ;
54035421 document . getElementById ( 'pref-fontFace' ) . value = prefs . fontFace ;
5422+ document . getElementById ( 'pref-powerlineSymbols' ) . checked = prefs . powerlineSymbols ;
54045423 document . getElementById ( 'pref-fontSize' ) . value = prefs . fontSize ;
54055424 document . getElementById ( 'pref-fontWeight' ) . value = prefs . fontWeight ;
54065425 document . getElementById ( 'pref-cursorStyle' ) . value = prefs . cursorStyle ;
@@ -5486,20 +5505,21 @@ <h3>Session expired</h3>
54865505 prefs . urlClickAction = document . getElementById ( 'pref-urlClickAction' ) . value ;
54875506 prefs . colorScheme = document . getElementById ( 'pref-colorScheme' ) . value ;
54885507 prefs . fontFace = document . getElementById ( 'pref-fontFace' ) . value ;
5508+ prefs . powerlineSymbols = document . getElementById ( 'pref-powerlineSymbols' ) . checked ;
54895509 prefs . fontSize = normalizeFontSize ( document . getElementById ( 'pref-fontSize' ) . value , prefs . fontSize ) ;
54905510 prefs . fontWeight = normalizeFontWeight ( document . getElementById ( 'pref-fontWeight' ) . value , prefs . fontWeight ) ;
54915511 prefs . cursorStyle = normalizeCursorStyle ( document . getElementById ( 'pref-cursorStyle' ) . value , prefs . cursorStyle ) ;
54925512 savePrefs ( prefs ) ;
54935513 terminals . forEach ( state => {
54945514 state . term . options . cursorStyle = prefs . cursorStyle ;
5495- state . term . options . fontFamily = prefs . fontFace ;
5515+ state . term . options . fontFamily = getTerminalFontFace ( ) ;
54965516 state . term . options . fontSize = prefs . fontSize ;
54975517 state . term . options . fontWeight = prefs . fontWeight ;
54985518 state . term . options . theme = SCHEMES [ prefs . colorScheme ] || SCHEMES . vintage ;
54995519 applyCjkWidthPreference ( state . term ) ;
55005520 if ( state . agentTerminalMirror ) {
55015521 state . agentTerminalMirror . options . cursorStyle = prefs . cursorStyle ;
5502- state . agentTerminalMirror . options . fontFamily = prefs . fontFace ;
5522+ state . agentTerminalMirror . options . fontFamily = getTerminalFontFace ( ) ;
55035523 state . agentTerminalMirror . options . fontSize = prefs . fontSize ;
55045524 state . agentTerminalMirror . options . fontWeight = prefs . fontWeight ;
55055525 state . agentTerminalMirror . options . theme = SCHEMES [ prefs . colorScheme ] || SCHEMES . vintage ;
0 commit comments