# C# - Stage #VQ0 (History - Down-arrow navigation)

**URL:** <https://forum.codecrafters.io/t/c-stage-vq0-history-down-arrow-navigation/11590>\
**Category:** Challenges\
**Tags:** challenge:shell\
**Created:** [June 3, 2025, 11:39am UTC](https://forum.codecrafters.io/t/c-stage-vq0-history-down-arrow-navigation/11590 "2025-06-03T11:39:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![inner](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/inner/32/4695_2.png) [@inner](https://forum.codecrafters.io/u/inner)\
**Post date:** [June 3, 2025, 11:39am UTC](https://forum.codecrafters.io/t/c-stage-vq0-history-down-arrow-navigation/11590/1 "2025-06-03T11:39:10Z")

</div>

Hello,

Excuse me for duplicating the topic - I didn’t know how to restore the previous one, but I’ve actually hit the issue here, hoping you could help solving it.

My code could be found [here](https://github.com/inner/codecrafters-shell-csharp).

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

locally seems it works as expected though (previous command came up by pressing UP arrow)

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

Thanks!

---

<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:** [June 3, 2025, 1:14pm UTC](https://forum.codecrafters.io/t/c-stage-vq0-history-down-arrow-navigation/11590/4 "2025-06-03T13:14:28Z")

</div>

Hey @inner, I tried commenting out `ClearCurrentLine()`:

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/7/7355c1b19d5a7804f6e55cef494b299cfcd8a3a8.png)

That improved things a bit:

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/2/295dbdac1ae975dfb37b7f94eeba4fd59cd0c9f3.jpeg)

Looks like overwriting with spaces isn’t fast enough. Our tester could catch the empty line mid-clear:

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

Let me know if you’d like further assistance!

---

<div class="post-metadata">

**Author:** ![inner](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/inner/32/4695_2.png) [@inner](https://forum.codecrafters.io/u/inner)\
**Post date:** [June 3, 2025, 1:37pm UTC](https://forum.codecrafters.io/t/c-stage-vq0-history-down-arrow-navigation/11590/6 "2025-06-03T13:37:53Z")

</div>

Thanks. I will re-think this!

---

<div class="post-metadata">

**Author:** ![adamadair](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/adamadair/32/11313_2.png) [@adamadair](https://forum.codecrafters.io/u/adamadair)\
**Post date:** [June 5, 2025, 10:03pm UTC](https://forum.codecrafters.io/t/c-stage-vq0-history-down-arrow-navigation/11590/7 "2025-06-05T22:03:21Z")

</div>

I had this same exact issue when trying to pass that stage with C#. It took a lot of trial and error to get past it. What I found was that Console.SetCursorPosition doesn’t play well with the tester. Any code that I had that used that was doomed to fail. To clear existing text from the screen I had to write a series of “\b \b” to the screen, which is a backspace-space-backspace combination.

```auto
Console.Write("\b \b");

```

While the code is ugly, it passes the tests. Good Luck!

---

<div class="post-metadata">

**Author:** ![inner](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/inner/32/4695_2.png) [@inner](https://forum.codecrafters.io/u/inner)\
**Post date:** [June 6, 2025, 6:43pm UTC](https://forum.codecrafters.io/t/c-stage-vq0-history-down-arrow-navigation/11590/8 "2025-06-06T18:43:44Z")

</div>

Yep - fixed using this one:

```auto
Console.Write("\b \b");

```

Thanks!

---

<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:** [June 14, 2025, 11:04pm UTC](https://forum.codecrafters.io/t/c-stage-vq0-history-down-arrow-navigation/11590/9 "2025-06-14T23:04:22Z")

</div>

Closed on June 14, 2025, 11:04pm UTC

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