Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/compat/terminal.h # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / compat / terminal.h` 27 lines ยท 875 bytes Raw Blame History 1 #ifndef COMPAT_TERMINAL_H 2 #define COMPAT_TERMINAL_H 3 4 enum save_term_flags { 5 /* Save input and output settings */ 6 SAVE_TERM_DUPLEX = 1 << 0, 7 /* Save stdin rather than /dev/tty (fails if stdin is not a terminal) */ 8 SAVE_TERM_STDIN = 1 << 1, 9 }; 10 11 /* 12 * Save the terminal attributes so they can be restored later by a 13 * call to restore_term(). Note that every successful call to 14 * save_term() must be matched by a call to restore_term() even if the 15 * attributes have not been changed. Returns 0 on success, -1 on 16 * failure. 17 */ 18 int save_term(enum save_term_flags flags); 19 /* Restore the terminal attributes that were saved with save_term() */ 20 void restore_term(void); 21 22 char *git_terminal_prompt(const char *prompt, int echo); 23 24 /* Read a single keystroke, without echoing it to the terminal */ 25 int read_key_without_echo(struct strbuf *buf); 26 27 #endif /* COMPAT_TERMINAL_H */