History log of /haiku/data/etc/profile
Revision Date Author Comments
# 26d22ee8 03-Oct-2023 Zach Dykstra <dykstra.zachary@gmail.com>

shell: remove extraneous/conflicting function

The 'whence' function defined in /etc/profile serves a limited purpose
with Bash as the default shell. Bash already provides
which/type/command as built-ins, which the function simply wraps.

Additionally, zsh has a built-in 'whence' command, which is masked by
the definition in /etc/profile. The function does not work under zsh,
breaking core zsh functionality as a result.

Fixes #18612

Change-Id: Ia34d95ffd58b2cb06d71145a217a9017657fa4a3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6979
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 57ab322d 27-Oct-2018 Augustin Cavalier <waddlesplash@gmail.com>

profile: export PS1, don't just set it.

Technically the profile is supposed to be sourced, but it seems that
some scenarios / applications do not do this and instead run it.
Before the recent changes to PS1, it was also exported, and now
it is again. Should fix entering HaikuPorter chroots under the new profile.

Also renamed "ARCH" to "_ARCH" to better accomodate those
who are sourcing this file, in case they want to pass a variable
named ARCH through.


# abb35d28 23-Aug-2018 Adrien Destugues <pulkomandy@pulkomandy.tk>

Fix escaping of escape codes.

Without this, readline will compute the length of the prompt
incorrectly, leading to display artifacts.


# 9a152c9c 23-Aug-2018 Adrien Destugues <pulkomandy@pulkomandy.tk>

Change the prompt again.

As expected there was a lot of bikeshedding.

Just change the color of the path, green on success, red on failure.

Constraints taken into account:
- Keep the > for now
- Prompt should be as compact as possible for those of us using 80
column terminals.
- Prompt should not change size between success and error cases

Not taken into account:
- The feature should be accessible to colorblind people (we could
replace the > with another char but we couldn't find something that
looks suitable)


# 9d1582e3 21-Aug-2018 Augustin Cavalier <waddlesplash@gmail.com>

etc/profile: Add kallisti5's smiley-face $? indicator and use $ not >.

An example of the new prompt line format is:

~/Desktop/haiku :) $

Or if the last command exited in failure:

~/Desktop/haiku :( $

The smiley-face will be either dark green or red, also depending on
the command status.

I realize this could be a tad controversial, especially for those used
to the old prompt, but it seems to be a pretty useful feature to me
(and of course kallisti5 came up with it.) But if the bikeshed turns
out to be too large, we can revert it and deal with it after the beta.

As for $ vs > -- BeOS R5 used $, most modern Linux uses $, and having >
come after a space looks much stranger.


# e4fac182 21-Aug-2018 François Revol <revol@free.fr>

data/profile: fix and simplify secondary arch detection

The previous code was wrong: running bash --login was reported
as if we used setarch x86_gcc2.

Current code also saves 3 fork+exec.


# bddcee2a 21-Aug-2018 Augustin Cavalier <waddlesplash@gmail.com>

data: Fix locale setup in SetupEnvironment and remove it from etc/profile.

These changes were made to etc/profile by PulkoMandy last year, but he missed
making the change in SetupEnvironment. etc/profile calls SetupEnvironment,
so we can consolidate all this there.

Also clean up some syntax.


# 5f4f984a 23-Nov-2017 Adrien Destugues <pulkomandy@pulkomandy.tk>

etc/profile: Fix setting of LC_* variables

Since hrev51075, locale -m changed meaning to the one expected by POSIX
(it now lists character maps, instead of giving the current language).

Since the short options may change again (locale -c is still not doing
what POSIX requires), use long options instead. This is more readable
and POSIX doesn't specify anything there so we can name them however we
want.

Fixes date parsing in Python which relies on these variables to detect
the current locale.


# be9a7056 24-Mar-2017 Thorsten „mirabilos“ Glaser <tg@mirbsd.org>

Make /etc/profile compatible with non-bash shells again.

Fixes #13384.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 3c08adef 17-Sep-2016 Adrien Destugues <pulkomandy@pulkomandy.tk>

Add architecture to prompt when in getarch context.

Fixes #10687.


# 0975f16f 09-Jun-2015 Jessica Hamilton <jessica.l.hamilton@gmail.com>

setarch: use a login shell; fixes #12066.

* This also updates /etc/profile to detect whether our
parent process is a shell, and changes the banner
message accordingly.
* Also, pipe errors to /dev/null, in case grep is not
installed; this allows us to not require grep as a
dependency, and let the banner message do the right
thing.


# a2d9c453 24-Mar-2015 Axel Dörfler <axeld@pinc-software.de>

profile: enlarged HISTFILESIZE to 500.

* 50 isn't really contemporary anymore.


# be012e21 04-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

/etc/profile: Also source profile.d/*.sh files in data dirs

This allows packages to place files in data/profile.d to manipulate
the shell environment. They could already use settings/etc/profile.d,
but since there's no point in editing those files in most cases, placing
them there nonetheless doesn't make much sense.


# 4fd62caa 15-Sep-2012 Prasad Joshi <prasadjoshi.linux@gmail.com>

bash_profile: set ls color alias to auto

ls --color emits the color code irrespective of whether it is being
attached to terminal or not. Which might result in color codes being
added to file upon redirection.

auto option with ls --color emits the color codes only the output is
attached to terminal, otherwise the colors are turned off.

Fixes #8993.

Signed-off-by: Ryan Leavengood <leavengood@gmail.com>


# 98057dd0 23-Feb-2012 Oliver Tappe <zooey@hirschkaefer.de>

Adjust /bin/locale to print time-related locale, too.

* add support for printing the time-related locale (which may contain
a '@strings=messages' suffix if required by locale configuration
* adjust cmdline params of /bin/locale to be a bit clearer (but keep
support for -c for compatibility)
* adjust /etc/profile to invoke /bin/locale accordingly


# ff37608c 09-Jul-2011 Ryan Leavengood <leavengood@gmail.com>

Remove unneeded LC_ environment variables which are glibc extensions not
supported by Haiku's locale system. Thanks Oliver.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42400 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 83a30ba9 08-Jul-2011 Ryan Leavengood <leavengood@gmail.com>

Implement #7495 as per Matt and Ingo's suggestions.

The various LC_ environment variables (as well as LANG) are set in
/etc/profile, based on the output of this new simple bin command locale.
LANG and LC_CTYPE are set based on the first preferred language, whereas the
formatting variables are all set based on the formatting conventions language.

The list of LC_ variables are from the locale command on Linux.

Based on my testing, at least the date command obeys these variables.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42394 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4a135b33 19-Jun-2011 Brecht Machiels <brecht@mos6581.org>

* upgraded bash_completion to v1.3
* upgraded to subversion bash completion script shipped with subversion 1.6.17
* added git bash completion script shipped with git 1.7.5.4
* readded bash completion to the image

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42257 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e4a4fcc9 11-May-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Moved definitions of the USER and GROUP environmental variables from
SetupEnvironment to /etc/profile and use the "id" command. No need to set
SHELL, since the shell sets it anyway. Fixes #5966.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36788 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2dbf8cd7 29-Apr-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Source SetupEnvironment with the more portable ".".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36537 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f1a61cda 29-Apr-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Typo-fixed patch by mjw: Include SetupEnvironment from /etc/profile, so
shells started by remote login daemons (sshd, telnetd) also get the
environmental variables defined there. Closes #5789 and #2468.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36536 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d2802607 29-Jul-2009 Michael Lotz <mmlr@mlotz.ch>

Add export to our default profile to ignore duplicate history entries.
Fixes enhancement #4156.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31953 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9532f684 08-May-2009 Axel Dörfler <axeld@pinc-software.de>

* Removed the "cd" to home in /etc/profile, made sure that Tracker/Deskbar are
started from /boot/home. This closes ticket #3090.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30674 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 07a283fe 17-Apr-2009 Jérôme Duval <korli@users.berlios.de>

* added bash_completion 20060301, it should be cleaned up.
* enable bash_completion loading in etc/profile. this fixes on the second part #2886.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30233 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f70cad5c 03-Dec-2008 Axel Dörfler <axeld@pinc-software.de>

* Added "shopt -s checkwinsize" to our /etc/profile. This fixes bug #2514,
thanks Adrian!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28772 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9b0eb8c8 16-Oct-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed "lal" alias and added "-A" to "ll" instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28193 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 96490327 19-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed superfluous and wrong (history forward and backward search was
swapped) key bindings.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26026 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0dacda17 26-Apr-2008 François Revol <revol@free.fr>

A space after the prompt really helps selecting only the command with double-click in Terminal.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25185 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 425b1199 25-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

I don't know, if that makes is less almost-ksh compatible, but whence
(aka which) now returns 1 when it cannot find a specified command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25169 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4d49ac78 25-Feb-2008 François Revol <revol@free.fr>

Added my most used aliases: m=more and lal=ls -lA.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24112 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a381c8a0 24-Feb-2008 Axel Dörfler <axeld@pinc-software.de>

Added more or less standard aliases for "ls -l" (ll) and "ls -A" (la).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24111 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3955cf36 11-Feb-2005 Axel Dörfler <axeld@pinc-software.de>

We're now using the --color option for "ls" by default which enables
colored output on capable terminals.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11353 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0c7e169a 12-Nov-2004 Axel Dörfler <axeld@pinc-software.de>

Forgot to switch to the home directory.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9937 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1583190b 03-Nov-2004 Axel Dörfler <axeld@pinc-software.de>

Added initial version of some scripts for the boot process.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9776 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0975f16f7ca94b654cb6a55b3316daae89843abb 09-Jun-2015 Jessica Hamilton <jessica.l.hamilton@gmail.com>

setarch: use a login shell; fixes #12066.

* This also updates /etc/profile to detect whether our
parent process is a shell, and changes the banner
message accordingly.
* Also, pipe errors to /dev/null, in case grep is not
installed; this allows us to not require grep as a
dependency, and let the banner message do the right
thing.


# a2d9c45398ebcab924c89b2d4961bbebc2aeb3d6 24-Mar-2015 Axel Dörfler <axeld@pinc-software.de>

profile: enlarged HISTFILESIZE to 500.

* 50 isn't really contemporary anymore.


# be012e21222c4d8d70082d12353acb163dc60ba8 04-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

/etc/profile: Also source profile.d/*.sh files in data dirs

This allows packages to place files in data/profile.d to manipulate
the shell environment. They could already use settings/etc/profile.d,
but since there's no point in editing those files in most cases, placing
them there nonetheless doesn't make much sense.


# 4fd62caa9acc437534c41bbb7d3fc9d53e915005 15-Sep-2012 Prasad Joshi <prasadjoshi.linux@gmail.com>

bash_profile: set ls color alias to auto

ls --color emits the color code irrespective of whether it is being
attached to terminal or not. Which might result in color codes being
added to file upon redirection.

auto option with ls --color emits the color codes only the output is
attached to terminal, otherwise the colors are turned off.

Fixes #8993.

Signed-off-by: Ryan Leavengood <leavengood@gmail.com>


# 98057dd02a2411868fd4c35f7a48d20acfd92c23 23-Feb-2012 Oliver Tappe <zooey@hirschkaefer.de>

Adjust /bin/locale to print time-related locale, too.

* add support for printing the time-related locale (which may contain
a '@strings=messages' suffix if required by locale configuration
* adjust cmdline params of /bin/locale to be a bit clearer (but keep
support for -c for compatibility)
* adjust /etc/profile to invoke /bin/locale accordingly


# ff37608cc375a6256a27cf84a4d7fe39d5fd8f00 09-Jul-2011 Ryan Leavengood <leavengood@gmail.com>

Remove unneeded LC_ environment variables which are glibc extensions not
supported by Haiku's locale system. Thanks Oliver.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42400 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 83a30ba91e85b656b44631b50cce01a7919682e2 08-Jul-2011 Ryan Leavengood <leavengood@gmail.com>

Implement #7495 as per Matt and Ingo's suggestions.

The various LC_ environment variables (as well as LANG) are set in
/etc/profile, based on the output of this new simple bin command locale.
LANG and LC_CTYPE are set based on the first preferred language, whereas the
formatting variables are all set based on the formatting conventions language.

The list of LC_ variables are from the locale command on Linux.

Based on my testing, at least the date command obeys these variables.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42394 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4a135b33b704c48eb7bf0d23c26309182319a6ed 19-Jun-2011 Brecht Machiels <brecht@mos6581.org>

* upgraded bash_completion to v1.3
* upgraded to subversion bash completion script shipped with subversion 1.6.17
* added git bash completion script shipped with git 1.7.5.4
* readded bash completion to the image

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42257 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e4a4fcc9fb66a5be960b05f8de21e1f8e5b018c2 11-May-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Moved definitions of the USER and GROUP environmental variables from
SetupEnvironment to /etc/profile and use the "id" command. No need to set
SHELL, since the shell sets it anyway. Fixes #5966.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36788 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2dbf8cd72849b6fc4a83f44eb9dbd7d5f7aeeb65 29-Apr-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Source SetupEnvironment with the more portable ".".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36537 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f1a61cda9a0ab2c10b605fe7d7c69775a6175edb 29-Apr-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Typo-fixed patch by mjw: Include SetupEnvironment from /etc/profile, so
shells started by remote login daemons (sshd, telnetd) also get the
environmental variables defined there. Closes #5789 and #2468.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36536 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d2802607429dc1ced0c34a0133aef5aa031ae512 29-Jul-2009 Michael Lotz <mmlr@mlotz.ch>

Add export to our default profile to ignore duplicate history entries.
Fixes enhancement #4156.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31953 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9532f6844f700c6787dc6038c5a50a6da9f02895 08-May-2009 Axel Dörfler <axeld@pinc-software.de>

* Removed the "cd" to home in /etc/profile, made sure that Tracker/Deskbar are
started from /boot/home. This closes ticket #3090.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30674 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 07a283fec324a82c5398a58c5551c8ed01356638 17-Apr-2009 Jérôme Duval <korli@users.berlios.de>

* added bash_completion 20060301, it should be cleaned up.
* enable bash_completion loading in etc/profile. this fixes on the second part #2886.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30233 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f70cad5cf8b321eb08cee83c02397442543ca65b 03-Dec-2008 Axel Dörfler <axeld@pinc-software.de>

* Added "shopt -s checkwinsize" to our /etc/profile. This fixes bug #2514,
thanks Adrian!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28772 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9b0eb8c8f43ba7fd76ffd1c645a53d95a192909f 16-Oct-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed "lal" alias and added "-A" to "ll" instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28193 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 96490327ca254c5b2e989fb3fc20c4d36c2c6f93 19-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed superfluous and wrong (history forward and backward search was
swapped) key bindings.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26026 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0dacda17d52333639ef3874b7e67702b646a5672 26-Apr-2008 François Revol <revol@free.fr>

A space after the prompt really helps selecting only the command with double-click in Terminal.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25185 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 425b1199b0cb2116ac84cd286d29569e62d86774 25-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

I don't know, if that makes is less almost-ksh compatible, but whence
(aka which) now returns 1 when it cannot find a specified command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25169 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4d49ac789d830837145ca05f60f04bb01472b5e8 25-Feb-2008 François Revol <revol@free.fr>

Added my most used aliases: m=more and lal=ls -lA.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24112 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a381c8a06378de22ff08adf4282b4e3f7e50d250 24-Feb-2008 Axel Dörfler <axeld@pinc-software.de>

Added more or less standard aliases for "ls -l" (ll) and "ls -A" (la).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24111 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3955cf36784729aecf43dc148b9bfda5ef0f7330 11-Feb-2005 Axel Dörfler <axeld@pinc-software.de>

We're now using the --color option for "ls" by default which enables
colored output on capable terminals.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11353 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0c7e169a8c78fee51ad3a58fcb36bfa59b31b4ff 12-Nov-2004 Axel Dörfler <axeld@pinc-software.de>

Forgot to switch to the home directory.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9937 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1583190bd89da68fd1d0475b7c31dff734f4ee92 03-Nov-2004 Axel Dörfler <axeld@pinc-software.de>

Added initial version of some scripts for the boot process.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9776 a95241bf-73f2-0310-859d-f6bbb57e9c96