Commit graph

15 commits

Author SHA1 Message Date
Josh Gao
0e165c594a mkshrc: set +o nohup.
Turn off nohup in mkshrc so that backgrounded jobs receive SIGHUP when
the parent shell exits.

Bug: http://b/76116378
Test: manual
Change-Id: I347d25013df107e6bd2e985a0a14e022c9fdf2ab
2018-03-21 18:19:50 -07:00
Elliott Hughes
80e6a7993f adbd handles $TMPDIR now.
Bug: http://b/19635681
Test: printenv
Change-Id: I5a957a5e68739bdbc2415962c0b9cd93e154090e
2017-12-11 10:40:13 -08:00
Elliott Hughes
1255a78d21 Stop setting $HOSTNAME in mkshrc.
bash sets this itself. mksh doesn't, but we can set it in adbd instead.

Bug: N/A
Test: `adb shell printenv` and `adb shell`, `printenv`
Change-Id: I3967681c9c6f7bf9b1365f8361e4960e40e4f916
2017-10-03 08:42:27 -07:00
Elliott Hughes
4ad1394a3c adbd sets $TERM now.
Bug: http://b/25601436
Change-Id: I532233a1cf349ac0117bdfb898ef050c42357178
2015-11-16 11:09:40 -08:00
Elliott Hughes
d45dd20c43 adbd sets HOME/LOGNAME/SHELL/USER now.
We also don't need to export variables we inherited --- they're
automatically exported.

Bug: http://b/19635681
Change-Id: Ie8e8480e7487ddc0fb9e984235b8b5ea0c587686
2015-11-02 14:40:16 -08:00
Elliott Hughes
a888b29057 Remove hd.
hd was only usable from interactive shells. xxd is more functional and usable
from interactive and non-interactive shells.

Change-Id: I294acea221e20ca46b6bc7e8e34906bd5d1b6dad
2015-09-25 08:12:29 -07:00
Elliott Hughes
7cad83fe64 Remove setenv.
No one is expecting the C shell any more.

Change-Id: Iff9422d254a51c988f2a6157379660b4ddaa617f
2015-09-25 08:11:32 -07:00
Elliott Hughes
91528bac84 Remove auto addition of ~/bin subdirectories to the path.
Change-Id: Icde133fb21fa93ba3909b40da62da81654be1bab
2015-09-25 08:11:32 -07:00
Elliott Hughes
50012061ca Upgrade to mksh 50e.
Change-Id: I341673d83c67f83761aa02c8372da6bbc419286f
2015-03-10 22:22:24 -07:00
Elliott Hughes
417ccf4906 Set $TMPDIR to /data/local/tmp, and use id -un to get the user's name.
Needed to make various command-line tools work out of the box, since we
don't have /tmp, which is what they'd naturally fall back to.

Change-Id: I3091d5ec9235f977de4a698a34f1f147a69e8a33
2015-02-09 12:25:41 -08:00
Elliott Hughes
11ed7f9d7c Default to xterm, remove some cruft.
gtest won't color its output unless TERM is an xterm, and that seems as
reasonable a default as vt100. More reasonable, in fact. This only fixes
things for login shells, so we still need to fix adb to pass $TERM
through to make yabinc happy...

We can get a better more(1) from toybox, and the aliases seem inappropriate.

Change-Id: Id73035d69ab421b179b9beb575d4e1607fbcce62
2014-12-11 17:13:19 -08:00
Thorsten Glaser
c6476acc33 cat builtin: permit interrupt during writing; more: avoid SIGPIPE
(cherry picked from commit 353204547d)

Change-Id: I740d8da02577b8c7acc74c297f110a2a913ae2bf
2014-08-05 12:47:21 -07:00
Thorsten Glaser
811a575c0f Update to mksh R48
Change-Id: I4d1bef9bf8ddc7899cfb32a6f2fa9e6f632bc53f
2013-08-14 21:33:39 +00:00
Thorsten Glaser
c2dc5def5e Update mksh to R43 (formal release, from tarball)
The files in src/ are just the unmodified mksh release .tgz
and is Not a Contribution to Android, it’s the upstream code
project. ChangeLog: https://www.mirbsd.org/mksh.htm#clog

Changes, other than upstream mksh code:
• update Copyright years
• sync with moving to a different AOSP project and other AOSP changes
• mkmf.sh: add test compilation mode
• be conservative in filedescriptor usage
• don’t compile the $MirOS$ RCS IDs into the binary to save space
• enable UTF-8 mode, to match reality
• help memory leak debugging by adding -DDEBUG_LEAKS
• update rest of mkmf.sh to work with updated AOSP and mksh
• use ro.product.device property as default hostname in mkshrc
  (originally submitted by John Michelau <john.michelau@motorola.com>)
• do not export PS1 in mkshrc (cross-shell developers agreed on this)
• add “more” function to mkshrc to get a simplistic pager
• add “hd” and “setenv” functions to mkshrc for better UX
• mention Launchpad as upstream bugtracker as comment in mkshrc
• change TMPDIR to /data/local/tmp for now, as /sqlite_stmt_journals is gone
  (although this is still no full replacement, it’s better than before)
• address the segfaults seen by DONG-DONG YANG

Change-Id: I2d4d175bc5163b3d6f5098024f98f316fe812e55
2013-02-19 19:58:27 +00:00
Jean-Baptiste Queru
5155f1c743 Move mksh to a separate project.
This was originally in system/core/mksh

commit ba2627c6cdb3aaa40aebd362170c382b55b7b511
Author: Thorsten Glaser <tg@mirbsd.org>
Date:   Tue Aug 24 18:21:37 2010 +0200

    Add mksh from CVS 2010/08/24 as system/core/mksh module

    Both shells (ash from system/core/sh, and mksh) are built by
    default but only the one where $(TARGET_SHELL) is set to is
    actually installed (the shell and the mkshrc configuration
    file are tagged shell_mksh for this to work).

commit f41986bbc79055a4feed7266cac5c1b540296daf
Author: Jeff Hamilton <jham@android.com>
Date:   Fri Sep 10 10:46:06 2010 -0500

    Don't alias 'stop' to 'kill -STOP'

    Android has already has a stop command used
    to stop the main runtime and the alias
    interferes with testing tools that expect
    stop to kill the runtime.

Change-Id: I5ddf28dbd0221148d3b8f55eaf4f1e7d046c9288
2011-06-16 10:05:28 -07:00