File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1119,22 +1119,24 @@ static bool terminalSupportsDefinedKeys(const char* termType) {
1119
1119
return false;
1120
1120
}
1121
1121
1122
+ #define IS_END_OR_DASH (ch ) ((ch) == '-' || (ch) == '\0')
1123
+
1122
1124
switch (termType [0 ]) {
1123
1125
case 'a' :
1124
1126
if (String_eq (termType , "alacritty" )) {
1125
1127
return true;
1126
1128
}
1127
1129
break ;
1128
1130
case 's' :
1129
- if (termType [1 ] == 't' && ( termType [ 2 ] == '-' || ! termType [2 ])) {
1131
+ if (termType [1 ] == 't' && IS_END_OR_DASH ( termType [2 ])) {
1130
1132
return true;
1131
1133
}
1132
- if (String_eq (termType , "screen" )) {
1134
+ if (String_startsWith (termType , "screen" ) && IS_END_OR_DASH ( termType [ 6 ] )) {
1133
1135
return true;
1134
1136
}
1135
1137
break ;
1136
1138
case 't' :
1137
- if (String_eq (termType , "tmux" )) {
1139
+ if (String_startsWith (termType , "tmux" ) && IS_END_OR_DASH ( termType [ 4 ] )) {
1138
1140
return true;
1139
1141
}
1140
1142
break ;
@@ -1144,7 +1146,7 @@ static bool terminalSupportsDefinedKeys(const char* termType) {
1144
1146
}
1145
1147
break ;
1146
1148
case 'x' :
1147
- if (String_eq (termType , "xterm" )) {
1149
+ if (String_startsWith (termType , "xterm" ) && IS_END_OR_DASH ( termType [ 5 ] )) {
1148
1150
return true;
1149
1151
}
1150
1152
break ;
You can’t perform that action at this time.
0 commit comments