zsh-users
 help / color / mirror / code / Atom feed
* Change directory on invocation of zsh
@ 2004-10-16 21:39 Michael Prokop
  2004-10-17  3:56 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Prokop @ 2004-10-16 21:39 UTC (permalink / raw)
  To: zsh-users

Hello,

I'm using the latest zsh version of debian unstable (4.2.1).
I'm using rungetty on one of my systems.
My /etc/inittab looks like this:


1:12345:respawn:/bin/zsh --login -c "/usr/bin/grml-start ; /usr/bin/grml-screen" >/dev/tty1 2>&1 </dev/tty1
[...]
5:2345:respawn:/sbin/rungetty tty5 -u grml -g grml --autologin grml /bin/zsh


So I'm able to use autologin without doing login stuff.

My problem: when starting zsh my working directory is '/'.
Not just as user root but also as user 'grml'.

AFAIK the pam_env module is responsible for doing some basic
enviroment handling.  Because I don't use the PAM system I've a
little wrapper in my zsh config:

  ,---- [ /etc/zsh/zshrc ]
  | if [[ -z "$HOME" || "$HOME" == "/" ]] ; then
  |   if [[ `id -un` == "root" ]] ; then
  |      export HOME=/root
  |   else
  |      export HOME=/home/`id -un`
  |   fi
  | fi
  `----

Of course running 'cd' or 'cd $HOME' or 'cd ~' changes into my
homedirectory. But I'd like to change path already on login.
Doing something like '[ $SECONDS == "0" ] && cd $HOME' is a
workaround but changes the working directory to $HOME any time I'm
starting a new zsh. Am I on the wrong way?
Any ideas or any hints? Thanks!

thx && regards,
(-: Michael


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-10-17 19:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-16 21:39 Change directory on invocation of zsh Michael Prokop
2004-10-17  3:56 ` Bart Schaefer
2004-10-17 14:45   ` Michael Prokop
2004-10-17 16:26     ` Bart Schaefer
2004-10-17 18:55       ` Michael Prokop

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).