Open Piturnah opened 1 year ago
I think its not appropriate to fitt it in the command api. We use command strictly for writing ansi sequences to the writer. For things that do not fit into that structure, we expose custom functions e.g terminal_size, cursor_pos, etc....
Is this API more appropriate? Or would you rather a function like terminal::bell()
?
Sorry for late response. A function is better I think, that works similar to the other api's we have that do not fit the box
Adds a command that allows for ringing the terminal bell by printing the bell character.
Technically it's not an ansi code, so it felt slightly strange to put it under
Command::write_ansi
, but I don't think it makes sense to implement this separately from the Command API.I think it's somewhat justified if you reinterpret
write_ansi
as "write to the terminal potentially including ansi codes", but thenis_ansi_code_supported
doesn't make a lot of sense.But, this is one edge case so I think it's fairly reasonable. What do you think? I think this functionality - even though it's really as simple as printing a char - has a place in the Crossterm library
This should close #730