Solvednixpkgs installed terminfo does not load correctly when logging in to a zsh user over ssh

Issue description

On login, /nix/store/yw76cfca2rnhjm68zdf74sy9jwfv2rfy-set-environment:39: can't find terminal definition for xterm-termite is printed and the terminal is not fully functional. Rerunning the failed command, export TERM=$TERM, restores the terminal to full functionality despite TERMINFO_DIRS not having changed from the value it's set to earlier in that script.

Letting the default shell default to bash works around the issue.

Steps to reproduce

  1. Configure a user to use zsh as the default shell and install termite.terminfo in environment.systemPackages.
  2. Log into that user over ssh from inside termite.

Technical details

  • System: 16.09
  • Nix version: 1.11.4
  • Nixpkgs version: 16.09.824.e4fb65a
24 Answers

✔️Accepted Answer

I think, I got it. The problem is that TERMINFO_DIRS is set here and the corresponding export TERMINFO_DIRS=... is executed inside login shell, thus, login shell process itself doesn't have TERMINFO_DIRS in its own environment.

I added this to configuration.nix:

environment.sessionVariables = {
  TERMINFO_DIRS = "/run/current-system/sw/share/terminfo";

And it works now.

I'm not quite certain how to proceed with pull request since I don't understand the purpose of profileRelativeEnvVars and why TERMINFO_DIRS was put there and not in variables.

Related Issues:

nixpkgs glibc 2.27 breaks locale support
For ubuntu I added the following to my .bashrc: I recently updated to the latest version of master @...
nixpkgs Release quality 17.09
Hi there! Yes indeed we are quite proud of our release We merged thousands of pull requests addresse...
nixpkgs ZERO Hydra Failures 20.09
We have our first 20.09 stable evaluation completed: Thus th...
nixpkgs Steam: Proton games don't start anymore
This should be fixed in SteamLinuxRuntime_soldier depot 0.20210723.18 currently available in the cli...
nixpkgs Cannot create efi boot entry - No space left on device
FYI I've been running into this problem for some time and I also think this is a firmware problem ...
nixpkgs python3Packages.beautifulsoup4 fails to build on Darwin
@jupblb You can try removing lxml from the beautifulsoup4 dependencies It's not ideal and maintainer...
nixpkgs [20.09] plasma5: printer dialog not working
actually was able to get this working qtquickcontrols was getting prefixed first in QML2_IMPORT_PATH...
nixpkgs Steam / gtk+3 broken on master
NixPkgs master now has workarounds and binaries in cache; I expect this commit will soon hit the nix...
nixpkgs NixOS services: When to have a package option
My vote is to put it in for all services that have a relevant notion of packages backing them ...
nixpkgs package request: flutter
Hello I have made a PR with a working example of flutter There is still a few missing things (like l...
nixpkgs NixOS: nixos-rebuild fails with memory allocation for gzip -d
install-info: Cannot allocate memory for gzip -d To workaround this problem: Set your system to mast...
nixpkgs nixos-install fails with getting attributes of path /nix/store/...: No such file or directory
a workaround by @jonringer first let it complete and then run sudo nixos-install ...
nixpkgs All audio output devices gone after recent update
@oxalica: In the meantime you could use system.replaceRuntimeDependencies like this: ...
nixpkgs Raspberry Pi 3 Support
In retrospect actually mounting the FAT partition at /boot was a bad idea.. U-Boot can load the kern...
nixpkgs Investigate GNOME wayland support
If you want a better debuggability you can create a simple configuration GNOME Wayland session can b...
nixpkgs Visual Studio Code Live Share does not function (missing libstdc++)
Just wondering Issue description Visual Studio Code downloads a prebuilt exe to .vscode and tries to...
nixpkgs Nextcloud fresh install - Error: Command "upgrade" is not defined.
It doesn't look like the builds of nextcloud and postgres are cleaned up completely which is where i...
nixpkgs Support for the desktop protocol is missing in KIO after upgrading to plasma desktop 5.17.5
Using socket-activated D-Bus fixes this issue: I suspect that if the D-Bus session is started too ea...
nixpkgs installed terminfo does not load correctly when logging in to a zsh user over ssh
I think I got it The problem is that TERMINFO_DIRS is set here and the corresponding export TERMINFO...
nixpkgs Get navi10 (RX 5700 XT) amdgpu working
For anyone still following this issue all the necessary changes are in the master branch as of today...
axios Axios catch error returns javascript error not server response
I have exactly the same environment Try this: Modify from console.log(error) to console.log(
scrapy ' error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 '
@euler16 for scrapy with Python 3 you'll need with Python 2 you'll need I wanted to install scrapy i...
laradock Mysql. The server requested authentication method unknown to the client [caching_sha2_password]
alter user 'username'@'localhost' identified with mysql_native_password by 'password'; would fix it....
react navigation screenIsActive prop / componentDidFocus event for TabNavigator items
It probably makes sense to add lifecycle hooks to screens In one of my Tabs i need to load Data from...
meteor [] Error: ENFILE: file table overflow
I was getting the same after an upgrade to macOS Sierra Turns out macOS have a harsh limit on number...
ipython Last jedi release (0.18.0) is incompatible with ipython (7.19 and 7.18 tested); reason - column arg was deprecated, and now removed
As a temporary fix for anyone just trying to get things working again: It would be really nice if yo...
material ui Module not found: Can't resolve 'material-ui-icons/Menu' Martial Next
For anyone else experiencing this issue: npm install @material-ui/icons
laravel dompdf (1/1) ErrorException Non-static method Barryvdh\DomPDF\PDF::loadView() should not be called statically
This happens because you are namespacing the wrong PDF class You are namespacing Barryvdh\DomPDF\PDF...
webpacker localIdentName option moved in css-loader configuration
I faced same issue after upading css-loader but I solved it If you check css-loader readme ...
react navigation Send data back from child screen?
@itswaze You can do something along these lines to pass back from the child screen ...
react navigation How to goBack from nested StackNavigator?
@dhruvparmar372 According to the NOTE in the doc a navigator's navigation prop may not have the help...
axios POST request works in Browser but not on Node
This might be considered a duplicate of #789 I was able to use the form-data package with Axios in n...
react navigation Best pattern for a 'Save' button in the header
Try setting your component instance's handleSave function as a navigation state parameter after the ...
DefinitelyTyped [@types/react] RefObject.current should no longer be readonly
It's not It'a intentionally left readonly to ensure correct usage even if it's not frozen ...
react native navigation [V3][Android] FATAL EXCEPTION: create_react_context
OK after a good night of sleep I've found why I was having this issue In the I ...
ts node Custom typings not working with ts-node 8.0.2
When using with ts-node you have to add --files flag After updating to ts-node version 8.0.2 the cus...
ohmyzsh compinit:503: no such file or directory: /usr/local/share/zsh/site-functions/_brew
Per #9602 (comment) brew cleanup fixed it for me I am using Apple M1 When I added this line: export ...
laradock SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
+1 I'm having the same problem here. Info: Docker version ($ docker --version): Docker version 17.12...
vagrant vagrant box update - Fails with 404 Not Found error
A workarround to add in your Vagrantfile: Vagrant version Host operating system Ubuntu 16.04.3 LTS G...
vagrant vagrant --help displays a rubygems error
To fix this error: Vagrant version Host operating system Expected behavior vagrant and vagrant --hel...
date fns Can't resolve 'date-fns/_lib/format/longFormatters'
You probably forgot to install date-fns or Code: import DateFnsUtils from '@date-io/date-fns'; ...
virtualenv Error creating virtualenv with python3.6
The original poster's problem is due to not having the 'python3.6-venv' package installed ...
provider A Product was used after being disposed. flutter: Once you have called dispose() on a Product, it can no longer be used.
Oh I see what you're doing Don't: DO: i have a ChangeNotifireProvider that such that i do pushReplac...
react navigation Reset to nested route, "There is no route defined for..."
A quick workaround (not heavily tested): set the key property to null on your action. ...
axios Adding headers to method
Edit: I had to add Authorization to allowed headers in my CORS filter @jffernandez I'm having the sa...
axios Adding Retry Parameter
@mericsson I am too in need of exponential backoff when retrying I've put together the following whi...
homebrew openjdk Cask adoptopenjdk8 exists in multiple taps
I think AdoptOpenJDK8 should be removed from the homebrew-cask-versions repo Somone(TM) should proba...
nativescript cli TNS doctor doesn't recognize Xcode (High Sierra)
HI @philipfeldmann Can yhou please run xcodebuild -version and paste the output? May be Xcode is ins...
axios BaseURL not being used
Please IGNORE THIS ISSUE Found the problem: I was setting baseUrl but it should be baseURL. ...