Skip to content

Commit

Permalink
Fix PS1 inside of nix develop
Browse files Browse the repository at this point in the history
The old `PS1` broke line-wrapping because it didn't escape
the terminal escape sequences need to themselves be escaped.
See:

https://stackoverflow.com/a/342135/1026598

The fix is to surround both escape sequences with `\[…\]` and
then Bash correctly handles line wrapping.
  • Loading branch information
Gabriella439 authored and supersven committed Feb 10, 2023
1 parent 2d1399a commit 84e4f9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
description = "ghc.nix - the ghc devShell";
nixConfig.bash-prompt = "\\e[34;1mghc.nix ~ \\e[0m";
nixConfig.bash-prompt = "\\[\\e[34;1m\\]ghc.nix ~ \\[\\e[0m\\]";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
Expand Down

0 comments on commit 84e4f9c

Please sign in to comment.