[PATCH] terminal: run $SHELL if set

Kristian Høgsberg krh at bitplanet.net
Tue Feb 7 13:26:17 PST 2012


On Fri, Feb 3, 2012 at 5:58 AM, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Nice, thanks.

Kristian

>  clients/terminal.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/clients/terminal.c b/clients/terminal.c
> index e5baa0e..2cb1e58 100644
> --- a/clients/terminal.c
> +++ b/clients/terminal.c
> @@ -2370,6 +2370,7 @@ int main(int argc, char *argv[])
>  {
>        struct display *d;
>        struct terminal *terminal;
> +       const char *shell;
>
>        d = display_create(&argc, &argv, option_entries);
>        if (d == NULL) {
> @@ -2377,8 +2378,12 @@ int main(int argc, char *argv[])
>                return -1;
>        }
>
> +       shell = getenv("SHELL");
> +       if (!shell)
> +               shell = "/bin/bash";
> +
>        terminal = terminal_create(d, option_fullscreen);
> -       if (terminal_run(terminal, "/bin/bash"))
> +       if (terminal_run(terminal, shell))
>                exit(EXIT_FAILURE);
>
>        display_run(d);
> --
> 1.7.7.5
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list