# Autocompletion Jline issue

**URL:** <https://forum.codecrafters.io/t/autocompletion-jline-issue/15839>\
**Category:** Challenges\
**Tags:** challenge:shell\
**Created:** [January 27, 2026, 11:24am UTC](https://forum.codecrafters.io/t/autocompletion-jline-issue/15839 "2026-01-27T11:24:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Molik2801](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/molik2801/32/21622_2.png) [@Molik2801](https://forum.codecrafters.io/u/Molik2801)\
**Post date:** [January 27, 2026, 11:24am UTC](https://forum.codecrafters.io/t/autocompletion-jline-issue/15839/1 "2026-01-27T11:24:17Z")

</div>

I am currently using JLine library for its autocompletion feature.  
I am currentlys stuck in this test case where we are needed to parse the executable. and i think i am parsing it correctly. i cant figure out whats the problem.

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

here is the github repo : [GitHub - Molik2801/codecrafters-shell-java](https://github.com/Molik2801/codecrafters-shell-java)

---

<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 27, 2026, 11:28am UTC](https://forum.codecrafters.io/t/autocompletion-jline-issue/15839/4 "2026-01-27T11:28:50Z")

</div>

Hey @Molik2801, this looks like a quoting issue.

Only the part highlighted in red is the executable name. Everything after that (i.e. /tmp/pig/f3) are argument(s), not part of the executable name:

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/4/6/467fccb7aae64b2b9d930c18ca96c9ad76d0e1b7.jpeg)

---

<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 27, 2026, 11:33am UTC](https://forum.codecrafters.io/t/autocompletion-jline-issue/15839/6 "2026-01-27T11:33:15Z")

</div>

I tried running your code against the previous stages, but it’s actually no longer passing a previous stage **#YT5 (Quoting - Backslash outside quotes)**.

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

**Suggestions** :

1. Use [our CLI](https://docs.codecrafters.io/cli/installation) to test against previous stages by running:

```auto
codecrafters test --previous

```

1. Focus on fixing the early stages first, as later stages depend on them.

---

<div class="post-metadata">

**Author:** ![Molik2801](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/molik2801/32/21622_2.png) [@Molik2801](https://forum.codecrafters.io/u/Molik2801)\
**Post date:** [January 27, 2026, 11:42am UTC](https://forum.codecrafters.io/t/autocompletion-jline-issue/15839/7 "2026-01-27T11:42:08Z")

</div>

ya i know thats why i printed my input and getting correct inputs , here i got two element in input , where first is execcutable and seccond is argument.  
this problem is happening after i used JLine.

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

---

<div class="post-metadata">

**Author:** ![Molik2801](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/molik2801/32/21622_2.png) [@Molik2801](https://forum.codecrafters.io/u/Molik2801)\
**Post date:** [January 27, 2026, 11:53am UTC](https://forum.codecrafters.io/t/autocompletion-jline-issue/15839/8 "2026-01-27T11:53:22Z")

</div>

i found out that Jline is parsing beforehand so it is giving wrong output.  
how can i fix that.  
Like Jline is parsing echo hi \ \ \ hi as hi hi , instead of hi hi. means it is removing the extra spaces on its own. how can i reimplement that.

---

<div class="post-metadata">

**Author:** ![Molik2801](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/molik2801/32/21622_2.png) [@Molik2801](https://forum.codecrafters.io/u/Molik2801)\
**Post date:** [January 27, 2026, 12:16pm UTC](https://forum.codecrafters.io/t/autocompletion-jline-issue/15839/9 "2026-01-27T12:16:10Z")

</div>

Hey Problem Solved Finally after 2 Weeks 😮‍💨 .

i have to change the Jline behaviour of taking backslash into consideration and removing it before giving it to my Parser code.  
so ,  
var parser = new DefaultParser();

parser.setEscapeChars(new char[0]);

these lines made sure that Jline is not eating away my backslash  
rest was fine.

---

<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 1, 2026, 12:16pm UTC](https://forum.codecrafters.io/t/autocompletion-jline-issue/15839/10 "2026-02-01T12:16:17Z")

</div>

Closed on February 1, 2026, 12:16pm UTC

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