]> git.ipfire.org Git - thirdparty/git.git/blame - compat/terminal.h
Merge branch 'rs/opt-parse-long-fixups'
[thirdparty/git.git] / compat / terminal.h
CommitLineData
21aeafce
JK
1#ifndef COMPAT_TERMINAL_H
2#define COMPAT_TERMINAL_H
3
02af15de
PW
4enum save_term_flags {
5 /* Save input and output settings */
6 SAVE_TERM_DUPLEX = 1 << 0,
e4938ce3
PW
7 /* Save stdin rather than /dev/tty (fails if stdin is not a terminal) */
8 SAVE_TERM_STDIN = 1 << 1,
02af15de
PW
9};
10
f7da7565
PW
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 */
02af15de 18int save_term(enum save_term_flags flags);
f7da7565 19/* Restore the terminal attributes that were saved with save_term() */
e22b245e
CMAB
20void restore_term(void);
21
21aeafce
JK
22char *git_terminal_prompt(const char *prompt, int echo);
23
a5e46e6b
JS
24/* Read a single keystroke, without echoing it to the terminal */
25int read_key_without_echo(struct strbuf *buf);
26
21aeafce 27#endif /* COMPAT_TERMINAL_H */