[PR #14851] fix(readline): respect USERPROFILE env var for portable installations #25414

Open
opened 2026-04-19 18:12:24 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14851
Author: @LincolnBurrows2017
Created: 3/14/2026
Status: 🔄 Open

Base: mainHead: fix/history-home-dir-portability


📝 Commits (2)

  • ec8abc7 fix(readline): respect USERPROFILE env var for portable installations
  • 151cb50 fix: use model.CapabilityThinking instead of string in Capabilities()

📊 Changes

2 files changed (+23 additions, -4 deletions)

View changed files

📝 readline/history.go (+22 -3)
📝 server/images.go (+1 -1)

📄 Description

On Windows, os.UserHomeDir() does not respect changes to the %USERPROFILE% environment variable, which breaks portable installations that set a custom profile directory.

This fix checks the HOME and USERPROFILE environment variables first before falling back to os.UserHomeDir(), allowing the chat history file location to respect environment variable changes for portable Ollama installations.

Fixes: #14847


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/14851 **Author:** [@LincolnBurrows2017](https://github.com/LincolnBurrows2017) **Created:** 3/14/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/history-home-dir-portability` --- ### 📝 Commits (2) - [`ec8abc7`](https://github.com/ollama/ollama/commit/ec8abc77d750a79690de42af8ccf6d0cfe5e17b8) fix(readline): respect USERPROFILE env var for portable installations - [`151cb50`](https://github.com/ollama/ollama/commit/151cb50aa16bf7b455f0781314de15dcca72eb02) fix: use model.CapabilityThinking instead of string in Capabilities() ### 📊 Changes **2 files changed** (+23 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `readline/history.go` (+22 -3) 📝 `server/images.go` (+1 -1) </details> ### 📄 Description On Windows, `os.UserHomeDir()` does not respect changes to the `%USERPROFILE%` environment variable, which breaks portable installations that set a custom profile directory. This fix checks the `HOME` and `USERPROFILE` environment variables first before falling back to `os.UserHomeDir()`, allowing the chat history file location to respect environment variable changes for portable Ollama installations. Fixes: #14847 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-19 18:12:24 -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#25414