Set $PWD to the value specified by the -w option, for the sake of consistency.

Quote:

  Some lines of shells are sometimes better than lengthly explainations:

    $ mkdir -p /tmp/a
    $ cd /tmp/a
    $ proot -b /tmp/a:/test -w /test bash -c 'pwd'
    /tmp/a

  This should output `/test`. It seems that the directory change is
  not done is this particular case. It indeed does if the current working
  directory is different than the one being bind-mounted:

    $ mkdir -p /tmp/a
    $ cd /tmp
    $ proot -b /tmp/a:/test -w /test bash -c 'pwd'
    /test

  -- Jérémy Bobbio https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756935

As of my understanding, the Bash "pwd" builtin returns the content of
$PWD as-is when both the inode of "." and the inode of $PWD are the
same:

  $ mkdir -p /tmp/a/b
  $ cd /tmp/a
  $ env PWD=/tmp/a/b/.. proot -b /tmp/a:/test -w /test bash -c 'pwd'
  /tmp/a/b/..

This is the case when $PWD is bind-mounted to the path specified by
the -w argument. A workaround was to unset PWD before starting
PRoot. The solution is to make PRoot set PWD to the path specified by
the -w argument.

Reported-by: Jérémy Bobbio <lunar@debian.org>
Ref: https://github.com/cedric-vincent/PRoot/issues/64