# Shell implementation in rust , in the tab completion builtin

**URL:** <https://forum.codecrafters.io/t/shell-implementation-in-rust-in-the-tab-completion-builtin/15815>\
**Category:** Challenges\
**Tags:** challenge:shell\
**Created:** [January 21, 2026, 8:34pm UTC](https://forum.codecrafters.io/t/shell-implementation-in-rust-in-the-tab-completion-builtin/15815 "2026-01-21T20:34:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![harshitneversettle](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/harshitneversettle/32/22170_2.png) [@harshitneversettle](https://forum.codecrafters.io/u/harshitneversettle)\
**Post date:** [January 21, 2026, 8:34pm UTC](https://forum.codecrafters.io/t/shell-implementation-in-rust-in-the-tab-completion-builtin/15815/1 "2026-01-21T20:34:14Z")

</div>

] $ ls -1 nonexistent \>\> /tmp/rat/ant.mdj  
[tester::#UN3] ^ Line does not match expected value.  
[tester::#UN3] Expected: “$ ls -1 nonexistent \>\> /tmp/rat/ant.md”  
[tester::#UN3] Received: “$ ls -1 nonexistent \>\> /tmp/rat/ant.mdj”  
[tester::#UN3] Assertion failed.  
[tester::#UN3] Test failed

this is the error i got , everything is fine , after a lot of debuggig i am unable to spot the exact bug

---

<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:** [January 21, 2026, 8:43pm UTC](https://forum.codecrafters.io/t/shell-implementation-in-rust-in-the-tab-completion-builtin/15815/3 "2026-01-21T20:43:51Z")

</div>

Hey @harshitneversettle, could you take a look at your key parsing logic around the `ENTER` key?

In some languages, ENTER is treated as ~~`Alt+J`~~ `Ctrl+J` instead of `\n`, which can lead to a stray j showing up in the input.

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/2/b/2b1a7a1645ffdf51894002a7315a343f0f98b1d5.png)

---

<div class="post-metadata">

**Author:** ![harshitneversettle](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/harshitneversettle/32/22170_2.png) [@harshitneversettle](https://forum.codecrafters.io/u/harshitneversettle)\
**Post date:** [January 21, 2026, 10:29pm UTC](https://forum.codecrafters.io/t/shell-implementation-in-rust-in-the-tab-completion-builtin/15815/4 "2026-01-21T22:29:37Z")

</div>

Thanks for addressing my question andy1li

this is my Enter logic

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/a/8/a877a24ee84c1938edf6ede4f43469a492cf35b0.png)

according to me , the bug is is due to the raw mode enabled , but somehow i am unable to find that 🙂

---

<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:** [January 22, 2026, 4:43am UTC](https://forum.codecrafters.io/t/shell-implementation-in-rust-in-the-tab-completion-builtin/15815/5 "2026-01-22T04:43:00Z")

</div>

@harshitneversettle Thanks for sharing the screenshot! Could you try handling `Ctrl+J` the same way as `Enter`?

* * *

In **crossterm** , newline (`0xA`) is mapped to `Ctrl+J` in raw mode:

> <https://github.com/crossterm-rs/crossterm/blob/6af9116b6a8ba365d8d8e7a806cbce318498b84d/src/event/sys/unix/parse.rs#L95+L98>

> <https://github.com/crossterm-rs/crossterm/blob/6af9116b6a8ba365d8d8e7a806cbce318498b84d/src/event/sys/unix/parse.rs#L106+L109>

---

<div class="post-metadata">

**Author:** ![harshitneversettle](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/harshitneversettle/32/22170_2.png) [@harshitneversettle](https://forum.codecrafters.io/u/harshitneversettle)\
**Post date:** [January 22, 2026, 9:54am UTC](https://forum.codecrafters.io/t/shell-implementation-in-rust-in-the-tab-completion-builtin/15815/6 "2026-01-22T09:54:28Z")

</div>

cool , i will definitely go through it ,  
is there any way i can connect with you , for me , it is my x : [https://x.com/Harshit\_yad4v](https://x.com/Harshit_yad4v)  
would love to connect

---

<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:** [January 27, 2026, 9:55am UTC](https://forum.codecrafters.io/t/shell-implementation-in-rust-in-the-tab-completion-builtin/15815/7 "2026-01-27T09:55:18Z")

</div>

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