# Consult's \`find-file' behavior when typing "~"

**URL:** <https://forum.systemcrafters.net/t/consults-find-file-behavior-when-typing/1585>\
**Category:** Emacs\
**Created:** [May 1, 2025, 4:31pm UTC](https://forum.systemcrafters.net/t/consults-find-file-behavior-when-typing/1585 "2025-05-01T16:31:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eee](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@Eee](https://forum.systemcrafters.net/u/Eee)\
**Post date:** [May 1, 2025, 4:31pm UTC](https://forum.systemcrafters.net/t/consults-find-file-behavior-when-typing/1585/1 "2025-05-01T16:31:08Z")

</div>

Question also asked here:  
[Consult’s `find-file’ behavior when typing “~” - Emacs Stack Exchange](https://emacs.stackexchange.com/questions/83462/consults-find-file-behavior-when-typing)

I’m switching from `counsel` to `consult`.

`counsel` uses `counsel-find-file`. The behavior is that when I type `~`, it will automatically change the prompt to the home directory:

```auto
;; Initially it shows this
Find File: ~/dir1/dir2/

;; typing '~' gives this 
Find File: ~/

```

* * *

When I use `consult` it calls the built-in emacs `find-file`.

```auto
;; Initially it shows this:
Find File: ~/dir1/dir2/

;; typing '~' gives this:
Find File: ~/dir1/dir2/~

```

Is there a way to get `find-file` (and therefore `consult`) to behave like `counsel` when typing `~`?

---

<div class="post-metadata">

**Author:** ![tusharhero](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tusharhero](https://forum.systemcrafters.net/u/tusharhero)\
**Post date:** [May 2, 2025, 3:25am UTC](https://forum.systemcrafters.net/t/consults-find-file-behavior-when-typing/1585/2 "2025-05-02T03:25:03Z")

</div>

It does do that if you type `~/`.

---

<div class="post-metadata">

**Author:** ![Eee](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@Eee](https://forum.systemcrafters.net/u/Eee)\
**Post date:** [May 2, 2025, 7:22am UTC](https://forum.systemcrafters.net/t/consults-find-file-behavior-when-typing/1585/3 "2025-05-02T07:22:55Z")

</div>

@tusharhero I want the old path to go away like it did with counsel.

---

<div class="post-metadata">

**Author:** ![tusharhero](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tusharhero](https://forum.systemcrafters.net/u/tusharhero)\
**Post date:** [May 2, 2025, 7:35am UTC](https://forum.systemcrafters.net/t/consults-find-file-behavior-when-typing/1585/4 "2025-05-02T07:35:45Z")

</div>

Does it not do that if you type `~/`? Or do you need it to happen when  
you type `~`, I would recommend getting used to this behavior.

---

<div class="post-metadata">

**Author:** ![Eee](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@Eee](https://forum.systemcrafters.net/u/Eee)\
**Post date:** [May 2, 2025, 7:43am UTC](https://forum.systemcrafters.net/t/consults-find-file-behavior-when-typing/1585/5 "2025-05-02T07:43:01Z")

</div>

When I type ~/ it gives this:

~/dir1/dir2/~/

I would like emacs to delete ~/dir1/dir2/ so it would only show ~/

---

<div class="post-metadata">

**Author:** ![Eee](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@Eee](https://forum.systemcrafters.net/u/Eee)\
**Post date:** [May 2, 2025, 8:49am UTC](https://forum.systemcrafters.net/t/consults-find-file-behavior-when-typing/1585/6 "2025-05-02T08:49:42Z")

</div>

I have a solution here. Thanks minad!  
[Adjusting `find-file’ behavior when typing “~” · minad/consult · Discussion #1222](https://github.com/minad/consult/discussions/1222)

---

<div class="post-metadata">

**Author:** ![tusharhero](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tusharhero](https://forum.systemcrafters.net/u/tusharhero)\
**Post date:** [May 2, 2025, 9:22am UTC](https://forum.systemcrafters.net/t/consults-find-file-behavior-when-typing/1585/7 "2025-05-02T09:22:19Z")

</div>

It works for me with the builtin `fido-vertical-mode`.
