Commit Graph

84 Commits

Author SHA1 Message Date
Oscar Lesta
3af8011358 env vars: move XDG Base Dirs variable exports to SetupEnvironment
This makes sure that apps get access to these variables regardless if
they are started from a shell or from GUI (double-click from Tracker,
desklink, etc).

Fixes #18130.

Change-Id: I82e2884e460fad7d6ec16e7b624c5cd2fcf807df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5897
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-13 01:49:55 +00:00
Augustin Cavalier
57ab322d67 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.
2018-10-27 14:03:44 -04:00
Adrien Destugues
abb35d283f Fix escaping of escape codes.
Without this, readline will compute the length of the prompt
incorrectly, leading to display artifacts.
2018-08-23 20:27:58 +02:00
Adrien Destugues
9a152c9cb0 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)
2018-08-23 17:51:21 +02:00
Augustin Cavalier
9d1582e31a 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.
2018-08-21 21:13:51 -04:00
François Revol
e4fac18200 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.
2018-08-21 23:26:33 +02:00
Augustin Cavalier
bddcee2a27 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.
2018-08-21 17:01:53 -04:00
Adrien Destugues
5f4f984a94 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.
2017-11-23 14:50:11 +01:00
Thorsten „mirabilos“ Glaser
be9a70562e Make /etc/profile compatible with non-bash shells again.
Fixes #13384.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2017-03-25 12:04:08 +01:00
Adrien Destugues
3c08adef21 Add architecture to prompt when in getarch context.
Fixes #10687.
2016-09-17 18:06:41 +02:00
Jessica Hamilton
0975f16f7c 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.
2015-06-12 19:29:19 +12:00
Axel Dörfler
a2d9c45398 profile: enlarged HISTFILESIZE to 500.
* 50 isn't really contemporary anymore.
2015-03-24 22:41:52 +00:00
Augustin Cavalier
0de25abadc bash_completion: delete from tree.
This was an old version of bash_completion and not included in the
image. An haikuports recipe is available if you need it.

Fixes #11660.

Signed-off-by: Adrien Destugues <pulkomandy@gmail.com>
2015-01-05 12:03:45 +01:00
Adrien Destugues
ff0f13f37a readline: also restore behavior for directories.
Thanks to Diver for checking.
2014-10-19 12:20:57 +02:00
Adrien Destugues
41660cabf4 readline: enable mark-symlinked-directories
This allows "ls /sys<TAB>" to complete to "/system/" rather than
"/system". It restores the behavior as it was before we outsourced bash.
2014-10-19 12:14:08 +02:00
François Revol
b7e55f797d Some more comments on xdg_basedirs
At least WebOOB makes some use of those,
it should help unclutter the home directory.
2014-07-30 00:07:48 +02:00
François Revol
d06cbe081b Add a profile.d file for XDG Base Directory Specification
We declare most of the XDG environment variables for this spec:
- XDG_CONFIG_HOME
- XDG_DATA_HOME
- XDG_CONFIG_DIRS
- XDG_DATA_DIRS
- XDG_CACHE_HOME

I'm not yet sure what to do with XDG_RUNTIME_DIR.
2014-07-29 17:02:24 +02:00
Ingo Weinhold
be012e2122 /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.
2013-12-04 23:21:14 +01:00
Ingo Weinhold
f73f5d4c42 Initial changes to remove /boot/common
* find_directory() and hard-coded paths use /boot/system instead of
  /boot/common.
* The build system creates the writable directories in /boot/system
  instead of /boot/common.
* The build system no longer installs any packages in /boot/common.
2013-10-03 21:52:25 +02:00
Prasad Joshi
3cd9a30037 ls: Change color scheme for other writable directory (#4494)
The ls command, uses blue color for directories. For a directory that
has write permission for others, it uses green highlighting while
displaying the directory name. However, blue text and green highlight
is difficult to read.

The patch keeps the text color as blue and changes the highlight to
yellow.

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2012-10-21 14:53:45 +02:00
Prasad Joshi
642eeda1c1 Turn on the coloring with <ef>grep (ticket #9044)
All grep versions have the ability to display a colored
output. The patch turns on coloring in auto mode.

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2012-10-05 20:00:04 +02:00
Prasad Joshi
4fd62caa9a 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>
2012-10-03 15:23:57 -04:00
Oliver Tappe
98057dd02a 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
2012-02-23 23:15:36 +01:00
Ryan Leavengood
ff37608cc3 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
2011-07-09 17:25:22 +00:00
Ryan Leavengood
83a30ba91e 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
2011-07-09 04:29:20 +00:00
Brecht Machiels
4a135b33b7 * 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
2011-06-19 21:19:36 +00:00
Ingo Weinhold
e4a4fcc9fb 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
2010-05-11 14:55:23 +00:00
Matt Madia
75d1bce8d7 * Removed vimrc from the repository as per #5699
* Updated vim & KeymapSwitcher optional packages, provided by siarzhuk.
To note, I did not remove the 'vi' symlink creation as I'm uncertain as
to whether or not any unknown applications are hardcoded to use it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36753 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-08 19:11:45 +00:00
Ingo Weinhold
2dbf8cd728 Source SetupEnvironment with the more portable ".".
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36537 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-29 18:15:41 +00:00
Ingo Weinhold
f1a61cda9a 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
2010-04-29 16:47:05 +00:00
Axel Dörfler
51576592ed * This more or less fixes bash's UTF-8 support, and closes ticket #215.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34150 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-20 10:33:13 +00:00
Axel Dörfler
c6106a595d * Fixed bug in "fortune" that would let it crash if you'd point it to an empty
directory.
* Moved fortune files to "data/system/data" in the repository, and /system/data/
  in the file system.
* Got teapot.data location wrong in the repository.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33982 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 13:09:32 +00:00
Axel Dörfler
0491552bc3 * Moved the "fonts" directory into the "data" directory.
* Moved fonts to where they belong.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33981 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 12:30:06 +00:00
Axel Dörfler
126fd25b7a * Moved teapod.data from /etc to B_SYSTEM_DATA_DIRECTORY.
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33975 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 11:08:14 +00:00
Axel Dörfler
417ba86ea2 * Applied patch by "v"/olaf that adds a missing line. This closes bug #4771.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33585 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-14 12:35:21 +00:00
Jérôme Duval
dcb2c6fa97 updated DejaVu fonts to to 2.30
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33114 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-13 10:26:34 +00:00
Michael Lotz
d280260742 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
2009-07-29 23:49:16 +00:00
Jérôme Duval
9587a788d2 added subversion bash_completion from http://svn.collab.net/repos/svn/trunk/tools/client-side/bash_completion r37847
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31699 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-22 18:06:02 +00:00
Axel Dörfler
9532f6844f * 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
2009-05-08 14:29:29 +00:00
Jérôme Duval
d8c0f241b7 removed non applicable completion (linux, bsd)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30238 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-18 14:22:28 +00:00
Jérôme Duval
07a283fec3 * 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
2009-04-17 22:05:11 +00:00
Axel Dörfler
a6354157ca * Moved some stuff in data/etc/ to data/system/data because that's where
they now end up in the image.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29936 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-05 14:55:59 +00:00
Stephan Aßmus
000fe088a7 Patch by Ma Jie: Basically - make Poorman (the webserver) work. Libhttpd from
Jef Poskanzer is providing the backend, but had to be adopted in some ways.
Other issues in Poorman have been resolved.

When testing the license integration, I stumbled over some AboutSystem bugs,
basically clicking licenses would not open them. I fixed those in this patch,
sorry for mixing that up.

Note to Ma Jie: I changed the encoding of the libhttpd files to UTF-8!
(This affects only the (C) glyph.) Thanks a lot for your awesome work on
Poorman, it's really appreciated!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29906 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-04 21:03:19 +00:00
Axel Dörfler
f70cad5cf8 * 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
2008-12-03 21:23:04 +00:00
Ingo Weinhold
162fecef46 Added GNU GPL version 1 and Perl's version of the Artistic license.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28363 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-29 01:27:49 +00:00
Ingo Weinhold
9b0eb8c8f4 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
2008-10-16 21:34:15 +00:00
Ingo Weinhold
1352fb0975 Added GNU LGPL v2.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27786 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-29 22:33:32 +00:00
Ingo Weinhold
9d53445aa2 Added some more licenses.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27761 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-27 19:28:36 +00:00
Axel Dörfler
959ff00dde * Removed Bitstream Vera fonts, they are replaced by the DejaVu ones.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27502 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-14 11:16:12 +00:00
Jérôme Duval
b06a48ab8f updated DejaVu fonts to to 2.26
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27015 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-17 22:41:03 +00:00