# Elixir - Help needed: Tab completion in Elixir shell

**URL:** <https://forum.codecrafters.io/t/elixir-help-needed-tab-completion-in-elixir-shell/15919>\
**Category:** Challenges\
**Tags:** challenge:shell\
**Created:** [February 19, 2026, 12:29am UTC](https://forum.codecrafters.io/t/elixir-help-needed-tab-completion-in-elixir-shell/15919 "2026-02-19T00:29:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabrithedev](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/fabrithedev/32/22329_2.png) [@fabrithedev](https://forum.codecrafters.io/u/fabrithedev)\
**Post date:** [February 19, 2026, 12:29am UTC](https://forum.codecrafters.io/t/elixir-help-needed-tab-completion-in-elixir-shell/15919/1 "2026-02-19T00:29:54Z")

</div>

I have hit a wall with Stage #QP2 (Autocompletion - Builtin completion).

There’s no functional library in Elixir that can properly capture the Tab key when pressed.

I’ve tried multiple approaches:

- Raw mode with `stty`

- `:io.setopts/2`

- terminal handling lib (ex\_readline)

If anyone has successfully implemented real-time Tab completion in Elixir, I’d really appreciate your guidance or examples.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [February 19, 2026, 2:13am UTC](https://forum.codecrafters.io/t/elixir-help-needed-tab-completion-in-elixir-shell/15919/3 "2026-02-19T02:13:20Z")

</div>

Hey @fabrithedev,there is one [Elixir code example](https://app.codecrafters.io/courses/shell/stages/qp2/code-examples) available for this stage. Is that usefully?

---

<div class="post-metadata">

**Author:** ![fabrithedev](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/fabrithedev/32/22329_2.png) [@fabrithedev](https://forum.codecrafters.io/u/fabrithedev)\
**Post date:** [February 20, 2026, 5:45pm UTC](https://forum.codecrafters.io/t/elixir-help-needed-tab-completion-in-elixir-shell/15919/5 "2026-02-20T17:45:31Z")

</div>

I tried copying the entire code, but it didn’t work.

After looking more carefully through his code repository, I finally understood what he did. He used a clever “hack” to put the terminal into raw mode by implementing it in a C file. I copied that approach into my project, made a few adjustments, and now I can properly detect the input.

That was a tricky one!

**Maybe it would be a good idea to include some guidance about this in the exercise, since it’s not something very common. In Rust, for example, you can just use the rustyline crate and don’t need to worry about this.**

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [February 25, 2026, 5:46pm UTC](https://forum.codecrafters.io/t/elixir-help-needed-tab-completion-in-elixir-shell/15919/6 "2026-02-25T17:46:08Z")

</div>

Closed on February 25, 2026, 5:46pm UTC

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
