Devshell causes neovim terminal problems. Part II!

To start with: I am aware this issue has been brought up before. However, this was before a fix was introduced into nixOS specifically to counter this, and this post is written after that fix.

The problem is that the terminal prompt I have configured (oh-my-posh) for my shell interpreter (bash), specifically as brought up in Neovim within a flake’s devshell, is broken. I haven’t been able to replicate the issue outside of neovim, and I also haven’t been able to reproduce it outside of a nix-develop shell. As per the particular flake, I am using the same flake shown in the linked post. I am also running NixOS unstable.

I have a home-manager config which defines some functions in my bashrc, but no extra commands are run nor are environment variables are set there. I have oh-my-posh configured there, with bash integration enabled. but the entire rest of the configuration specifies the prompt itself.

As per the output of the shell, it outputs the following:

bash: shopt: progcomp: invalid shell option name
\[\]\[\]\[\]\[\] impure \[\]\[\]\[\]\[\]\[\]\[\] adriano@devstop \[\]\[\]\[\]\[\]\[\]\[\] 
0 \[\]\[\]\[\]                                                                              
\[\]\[\]\[\]\[\] ~/../Personal/codeProjects/test-nvim-flake \[\]\[\]\[\]                   
\[\]\[\] \[\] 

The coloring works fine though.

Suggested fixes that have not worked are:

  • Explicitly including pkgs.bashInteractive
    • Does nothing
  • Deleting the sourcing of bashrc from the .profile
    • Home-Manager provides no option to do so, and I am using a home-manager managed bash config.
  • Updating
    • As of the writing, I have updated both NixOS and the particular flake, and the problem persists

If there are any specific configs I could provide, please do say so. I do not include my NixOS config, because it is massive, but any relevant extracts can be provided.

The particular `shopt` warning suggests the shell is not being run interactively, but as stated, I have tried replacing bash with bashInteractive within the mkShell call, and this has not worked.