[GH-ISSUE #14847] Path of history file does not respect changed %USERPROFILE% variable on Windows #35337

Open
opened 2026-04-22 19:46:23 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @esrat on GitHub (Mar 14, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/14847

What is the issue?

The file path for the chat history is set in a different way than other paths, using the function call "os.UserHomeDir()" (in main/readline/history.go, line 41). I guess this call does not respect the currently set %USERPROFILE% but uses a system wide (?) value.
The effect is, when making ollama portable by changing this variable's value, all things are written to and loaded from the correct, new path, besides the chat history! The ".ollama" directory will always be created solely for the "history" file, within the user's directory. The portable installation directory will never see a chat history.

Expected behaviour:
The chat history should respect the %USERPROFILE% of the current context and be saved to the set directory.

Relevant log output


OS

Windows

GPU

No response

CPU

No response

Ollama version

No response

Originally created by @esrat on GitHub (Mar 14, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/14847 ### What is the issue? The file path for the chat history is set in a different way than other paths, using the function call "os.UserHomeDir()" (in main/readline/history.go, line 41). I guess this call does not respect the currently set %USERPROFILE% but uses a system wide (?) value. The effect is, when making ollama portable by changing this variable's value, all things are written to and loaded from the correct, new path, besides the chat history! The ".ollama" directory will always be created solely for the "history" file, within the user's directory. The portable installation directory will never see a chat history. Expected behaviour: The chat history should respect the %USERPROFILE% of the current context and be saved to the set directory. ### Relevant log output ```shell ``` ### OS Windows ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the bug label 2026-04-22 19:46:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#35337