@@ -1033,6 +1033,91 @@ export class TermViewModel implements ViewModel {
10331033 } ) ;
10341034 } ,
10351035 } ) ;
1036+ const overrideCursor = blockData ?. meta ?. [ "term:cursor" ] as string | null | undefined ;
1037+ const overrideCursorBlink = blockData ?. meta ?. [ "term:cursorblink" ] as boolean | null | undefined ;
1038+ const isCursorDefault = overrideCursor == null && overrideCursorBlink == null ;
1039+ // normalize for comparison: null/undefined/"block" all mean "block"
1040+ const effectiveCursor = overrideCursor === "underline" || overrideCursor === "bar" ? overrideCursor : "block" ;
1041+ const effectiveCursorBlink = overrideCursorBlink === true ;
1042+ const cursorSubMenu : ContextMenuItem [ ] = [
1043+ {
1044+ label : "Default" ,
1045+ type : "checkbox" ,
1046+ checked : isCursorDefault ,
1047+ click : ( ) => {
1048+ RpcApi . SetMetaCommand ( TabRpcClient , {
1049+ oref : WOS . makeORef ( "block" , this . blockId ) ,
1050+ meta : { "term:cursor" : null , "term:cursorblink" : null } ,
1051+ } ) ;
1052+ } ,
1053+ } ,
1054+ {
1055+ label : "Block" ,
1056+ type : "checkbox" ,
1057+ checked : ! isCursorDefault && effectiveCursor === "block" && ! effectiveCursorBlink ,
1058+ click : ( ) => {
1059+ RpcApi . SetMetaCommand ( TabRpcClient , {
1060+ oref : WOS . makeORef ( "block" , this . blockId ) ,
1061+ meta : { "term:cursor" : "block" , "term:cursorblink" : false } ,
1062+ } ) ;
1063+ } ,
1064+ } ,
1065+ {
1066+ label : "Block (Blinking)" ,
1067+ type : "checkbox" ,
1068+ checked : ! isCursorDefault && effectiveCursor === "block" && effectiveCursorBlink ,
1069+ click : ( ) => {
1070+ RpcApi . SetMetaCommand ( TabRpcClient , {
1071+ oref : WOS . makeORef ( "block" , this . blockId ) ,
1072+ meta : { "term:cursor" : "block" , "term:cursorblink" : true } ,
1073+ } ) ;
1074+ } ,
1075+ } ,
1076+ {
1077+ label : "Bar" ,
1078+ type : "checkbox" ,
1079+ checked : ! isCursorDefault && effectiveCursor === "bar" && ! effectiveCursorBlink ,
1080+ click : ( ) => {
1081+ RpcApi . SetMetaCommand ( TabRpcClient , {
1082+ oref : WOS . makeORef ( "block" , this . blockId ) ,
1083+ meta : { "term:cursor" : "bar" , "term:cursorblink" : false } ,
1084+ } ) ;
1085+ } ,
1086+ } ,
1087+ {
1088+ label : "Bar (Blinking)" ,
1089+ type : "checkbox" ,
1090+ checked : ! isCursorDefault && effectiveCursor === "bar" && effectiveCursorBlink ,
1091+ click : ( ) => {
1092+ RpcApi . SetMetaCommand ( TabRpcClient , {
1093+ oref : WOS . makeORef ( "block" , this . blockId ) ,
1094+ meta : { "term:cursor" : "bar" , "term:cursorblink" : true } ,
1095+ } ) ;
1096+ } ,
1097+ } ,
1098+ {
1099+ label : "Underline" ,
1100+ type : "checkbox" ,
1101+ checked : ! isCursorDefault && effectiveCursor === "underline" && ! effectiveCursorBlink ,
1102+ click : ( ) => {
1103+ RpcApi . SetMetaCommand ( TabRpcClient , {
1104+ oref : WOS . makeORef ( "block" , this . blockId ) ,
1105+ meta : { "term:cursor" : "underline" , "term:cursorblink" : false } ,
1106+ } ) ;
1107+ } ,
1108+ } ,
1109+ {
1110+ label : "Underline (Blinking)" ,
1111+ type : "checkbox" ,
1112+ checked : ! isCursorDefault && effectiveCursor === "underline" && effectiveCursorBlink ,
1113+ click : ( ) => {
1114+ RpcApi . SetMetaCommand ( TabRpcClient , {
1115+ oref : WOS . makeORef ( "block" , this . blockId ) ,
1116+ meta : { "term:cursor" : "underline" , "term:cursorblink" : true } ,
1117+ } ) ;
1118+ } ,
1119+ } ,
1120+ ] ;
10361121 fullMenu . push ( {
10371122 label : "Themes" ,
10381123 submenu : submenu ,
@@ -1041,6 +1126,10 @@ export class TermViewModel implements ViewModel {
10411126 label : "Font Size" ,
10421127 submenu : fontSizeSubMenu ,
10431128 } ) ;
1129+ fullMenu . push ( {
1130+ label : "Cursor" ,
1131+ submenu : cursorSubMenu ,
1132+ } ) ;
10441133 fullMenu . push ( {
10451134 label : "Transparency" ,
10461135 submenu : transparencySubMenu ,
0 commit comments