# Where Can I find documentation regarding TTY raw mode?

**URL:** <https://discourse.julialang.org/t/where-can-i-find-documentation-regarding-tty-raw-mode/87569>\
**Category:** General Usage\
**Created:** [September 21, 2022, 12:17pm UTC](https://discourse.julialang.org/t/where-can-i-find-documentation-regarding-tty-raw-mode/87569 "2022-09-21T12:17:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cshen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cshen/32/217287_2.png) [@cshen](https://discourse.julialang.org/u/cshen)\
**Post date:** [September 21, 2022, 12:17pm UTC](https://discourse.julialang.org/t/where-can-i-find-documentation-regarding-tty-raw-mode/87569/1 "2022-09-21T12:17:31Z")

</div>

I have been working on a project that utilises a bit of low level terminal manipulation code to manage its flow and interface.

I have encountered [again](https://discourse.julialang.org/t/wait-for-a-keypress/20218/4) and [again](https://discourse.julialang.org/t/keyboard-input-monitoring/87078) and [again](https://discourse.julialang.org/t/looking-for-the-correct-way-to-do-a-clean-julia-process-shutdown/46691/6) and [again](https://github.com/foldfelis/Terming.jl) mentions to this superhero `raw` mode that, after blindly using, it has actually fixed some of my problems.

Sadly, when I decided to go look this mode up i found next to nothing. Have not managed to find any delucidations online on what this mode is and what it entails, and I can’t even go look up what the function [`raw!`](https://github.com/JuliaLang/julia/blob/master/stdlib/REPL/src/Terminals.jl) does since it is just a `ccall` to `:jl_tty_set_mode`.

Where can I find some delucidations on what this is and why it works?

---

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [September 21, 2022, 12:41pm UTC](https://discourse.julialang.org/t/where-can-i-find-documentation-regarding-tty-raw-mode/87569/2 "2022-09-21T12:41:59Z")

</div>

Not a direct answer to your question, but it might help to know that “raw” terminal mode (as opposed to “cooked” or “line” mode) is not something that is specific to Julia. AFAIU these terms were popularized by the POSIX terminal interface specification. See for example this wikipedia article:

> **[POSIX terminal interface | History](https://en.wikipedia.org/wiki/POSIX_terminal_interface#History)**
>
> The POSIX terminal interface is derived from the terminal interfaces of various Unix systems.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [September 21, 2022, 12:46pm UTC](https://discourse.julialang.org/t/where-can-i-find-documentation-regarding-tty-raw-mode/87569/3 "2022-09-21T12:46:22Z")

</div>

Also see [Terminal mode - Wikipedia](https://en.wikipedia.org/wiki/Terminal_mode)

> In **cooked mode** data is [preprocessed](https://en.wikipedia.org/wiki/Preprocessor) before being given to a program, while **raw mode** passes the data as-is to the program without interpreting any of the special characters.

---

<div class="post-metadata">

**Author:** ![cshen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cshen/32/217287_2.png) [@cshen](https://discourse.julialang.org/u/cshen)\
**Post date:** [September 21, 2022, 2:54pm UTC](https://discourse.julialang.org/t/where-can-i-find-documentation-regarding-tty-raw-mode/87569/4 "2022-09-21T14:54:37Z")

</div>

That clarifies a lot. Thank you so mcuh.  
Just another minor clarification, when raw mode is disabled, is the REPL itself responsible for handling the preprocessing or does it just receive cooked inputs from a terminal emulator and interpret them?  
In short: at what level does the cooking happen? where’s the kitchen?
