31 #ifndef FTERMDETECTION_H 32 #define FTERMDETECTION_H 34 #if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) 35 #error "Only <final/final.h> can be included directly." 43 #include "final/fconfig.h" 44 #include "final/util/fstring.h" 60 auto getClassName()
const ->
FString;
62 auto getTermType()
const & ->
const FString&;
65 auto getAnswerbackString()
const & ->
const FString&;
66 auto getSecDAString()
const & ->
const FString&;
67 auto getTermType_256color()
const & ->
const FString&;
68 auto getTermType_Answerback()
const & ->
const FString&;
69 auto getTermType_SecDA()
const & ->
const FString&;
73 auto canDisplay256Colors()
const noexcept -> bool;
74 auto hasTerminalDetection()
const noexcept -> bool;
75 auto hasSetCursorStyleSupport()
const noexcept -> bool;
78 void setTerminalDetection (
bool =
true) noexcept;
79 void setTtyTypeFileName (
const FString&);
99 int terminal_id_type{-1};
100 int terminal_id_version{-1};
101 int terminal_id_hardware{-1};
105 using TermTypeMap = std::vector<std::pair<std::wstring, FTermType>>;
108 void getSystemTermType();
109 auto getTTYtype() -> bool;
111 auto getTTYSFileEntry() -> bool;
113 auto getTermBasename()
const ->
const char*;
114 template<
typename StringT>
115 auto startsWithTermType (StringT&&)
const -> bool;
116 void termtypeAnalysis();
117 auto findMatchingTerm (
const TermTypeMap&) -> TermTypeMap::const_iterator;
118 auto isTerminalWithoutDetection()
const -> bool;
119 void handleScreenAndTmux()
const;
120 void detectTerminal();
121 auto init_256colorTerminal() ->
FString;
122 auto get256colorEnvString() -> bool;
123 auto termtype_256color_quirks() ->
FString;
125 auto getXTermColorName (FColor)
const ->
FString;
127 auto getAnswerbackMsg()
const ->
FString;
129 auto str2int (
const FString&)
const -> int;
130 auto getSecDA()
const ->
FString;
135 auto secDA_Analysis_32 ()
const ->
FString;
137 auto secDA_Analysis_67 ()
const ->
FString;
138 auto secDA_Analysis_77 () ->
FString;
139 auto secDA_Analysis_82 ()
const ->
FString;
142 auto secDA_Analysis_85 ()
const ->
FString;
145 void correctFalseAssumptions (
int)
const;
154 FString ttytypename{
"/etc/ttytype"};
155 bool decscusr_support{
false};
156 bool terminal_detection{
true};
160 colorEnv color_env{};
161 secondaryDA secondary_da{};
167 inline auto FTermDetection::getClassName()
const ->
FString 168 {
return "FTermDetection"; }
171 inline auto FTermDetection::getTermType()
const & ->
const FString&
176 inline auto FTermDetection::getTermType_256color()
const & ->
const FString&
177 {
return termtype_256color; }
180 inline auto FTermDetection::getTermType_Answerback()
const & ->
const FString&
181 {
return termtype_Answerback; }
184 inline auto FTermDetection::getTermType_SecDA()
const & ->
const FString&
185 {
return termtype_SecDA; }
189 inline auto FTermDetection::canDisplay256Colors()
const noexcept ->
bool 193 inline auto FTermDetection::hasSetCursorStyleSupport()
const noexcept ->
bool 194 {
return decscusr_support; }
197 inline auto FTermDetection::hasTerminalDetection()
const noexcept ->
bool 198 {
return terminal_detection; }
201 inline void FTermDetection::setTerminalDetection (
bool enable) noexcept
202 { terminal_detection = enable; }
205 template<
typename StringT>
206 inline auto FTermDetection::startsWithTermType (StringT&& prefix)
const ->
bool 208 return termtype.toWString().find(std::forward<StringT>(prefix)) == 0;
213 #endif // FTERMDETECTION_H Definition: class_template.cpp:25
Definition: ftermdetection.h:53