;; Suppress `shell-file-name' for w32 systems.
(defcustom tramp-encoding-shell
(let (shell-file-name)
- (or (tramp-compat-funcall 'w32-shell-name) "/bin/sh"))
+ (or (tramp-compat-funcall 'w32-shell-name)
+ (if (eq system-type 'android)
+ ;; The shell is located at /system/bin/sh on Android
+ ;; systems.
+ "/system/bin/sh"
+ "/bin/sh")))
"Use this program for encoding and decoding commands on the local host.
This shell is used to execute the encoding and decoding command on the
local host, so if you want to use \"~\" in those commands, you should
(or explicit-shell-file-name
(getenv "ESHELL")
(getenv "SHELL")
- "/bin/sh"))
+ (if (eq system-type 'android)
+ "/system/bin/sh"
+ "/bin/sh")))
(s (read-string
(format "Run program in emulator (default %s): "
default-s))))
(push (format "EMACS=%s (term:%s)" emacs-version term-protocol-version)
process-environment))
(apply #'start-process name buffer
- "/bin/sh" "-c"
+ ;; On Android, /bin doesn't exist, and the default shell is
+ ;; found as /system/bin/sh.
+ (if (eq system-type 'android)
+ "/system/bin/sh"
+ "/bin/sh")
+ "-c"
(format "stty -nl echo rows %d columns %d sane 2>%s;\
if [ $1 = .. ]; then shift; fi; exec \"$@\""
term-height term-width null-device)
(defun artist-figlet-get-font-list ()
"Read fonts in with the shell command.
Returns a list of strings."
- (let* ((cmd-interpreter "/bin/sh")
+ (let* ((cmd-interpreter (if (eq system-type 'android)
+ "/system/bin/sh"
+ "/bin/sh"))
(ls-cmd artist-figlet-list-fonts-command)
(result (artist-system cmd-interpreter ls-cmd nil))
(exit-code (elt result 0))
/* Set TMPDIR to the temporary files directory. */
setenv ("TMPDIR", android_cache_dir, 1);
+ /* And finally set "SHELL" to /system/bin/sh. Otherwise, some
+ programs will look for /bin/sh, which is problematic. */
+ setenv ("SHELL", "/system/bin/sh", 1);
+
/* Set the cwd to that directory as well. */
if (chdir (android_files_dir))
__android_log_print (ANDROID_LOG_WARN, __func__,