簡體   English   中英

使用 NCurses 向終端發送轉義序列

[英]sending escape sequences to terminal with NCurses

所以我將 NCurses 用於一個項目,並且我使用它的終端接受特殊的轉義序列,用於播放音頻等自定義功能。 The position of the cursor doesn't matter while sending these escape sequences, however when using printf it doesn't get pushed to the output stream. 有沒有辦法繞過 ncurses 直接寫入終端? 我聽說可能會恢復流並在將它們還給 ncurses 之后,但這似乎很老套。

我最終找到了一個 hacky 解決方案,因為我只需要將轉義碼發送到終端模擬器(光標 position 和其他上下文無關緊要)

我使用 fputs 寫入 STDOUT,然后使用 fflush() 將其推送到終端。

fputs("\033]16;2", stdout);
fflush(stdout);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM