vercel / hyper

A terminal built on web technologies

Home Page:https://hyper.is

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

.hyper config location for macOS is incorrect in website

dheerajkysetti opened this issue · comments

  • I am on the latest Hyper.app 3.2.3 macOS arm64
  • I have searched the issues of this repo and believe that this is not a duplicate
  • OS 12.4 and macOS monterey M1:
  • Hyper.app 3.2.3:
  • default .hyper.js config:
  • The issue is reproducible in vanilla Hyper.app:

Issue

In the hyper.is website, when opened on a macOS m1(monterey), the configuration section shows
image

But the .hyper.js file in the ~/Library/Application Support/Hyper/.hyper.js is never read.
Only the ~/.hyper.js file works.

Taking a look at the code at tag 3.2.3

// If the user defines XDG_CONFIG_HOME they definitely want their config there,
// otherwise use the home directory in linux/mac and userdata in windows
const applicationDirectory =
process.env.XDG_CONFIG_HOME !== undefined
? join(process.env.XDG_CONFIG_HOME, 'hyper')
: process.platform == 'win32'
? app.getPath('userData')
: homedir();

The user directory does point to mac.

Does the website need to update the documentation or the code require a change to match the documentation?

(This also happens for Linux when XDG_CONFIG_HOME is not explicitly set) @dheerajkysetti check if your XDG_CONFIG_HOME is set

$ echo $XDG_CONFIG_HOME

Also, please check #6789 to verify if that behavior currently happen also on Mac. Thank you.

Edit: the documentation on the site is correct, as I point out in the issue that I opened, the actual 'issue' is another.

commented

@maxdevjs
It is not necessary to set XDG_CONFIG_HOME explicitly, the default value is $HOME/.config.

$XDG_CONFIG_HOME defines the base directory relative to which user-specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.

https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html