• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/net/

Lines Matching +defs:shell +defs:flag

94 (require 'shell)
245 (defcustom tramp-encoding-shell
250 This shell is used to execute the encoding and decoding command on the
252 choose a shell here which groks tilde expansion. `/bin/sh' normally
265 mechanisms in tramp.el which automatically determine the right shell to
271 (if (string-match "cmd\\.exe" tramp-encoding-shell)
274 "*Use this switch together with `tramp-encoding-shell' for local commands.
275 See the variable `tramp-encoding-shell' for more information."
288 tramp-encoding-shell
290 This variable is similar to `tramp-encoding-shell', but it is only used
292 commands sent to this shell is quite restricted, and if you are
294 shell which does not normally exist on Windows anyway).
299 This variable defaults to the value of `tramp-encoding-shell'."
304 ;; tramp-shell-quote-argument, except in tramp-handle-expand-many-files.
309 ;;- "*Protect these characters from the remote shell.
311 ;;-because it means something special to the shell. This takes effect
312 ;;-when sending file and directory names to the remote shell.
560 This specifies the Bourne shell to use on the remote host. This
561 MUST be a Bourne-like shell. It is normally not necessary to set
562 this to any value other than \"/bin/sh\": tramp wants to use a shell
674 function to be executed, and COMMAND is the shell command used for
889 You can use `~' in this list, but when searching for a shell which groks
903 (defcustom tramp-shell-prompt-pattern
905 "Regexp to match prompts from remote shell.
906 Normally, Tramp expects you to configure `shell-prompt-pattern'
908 remote host which sends a different kind of shell prompt. Therefore,
909 Tramp recognizes things matched by `shell-prompt-pattern' as prompt,
911 variable is similar to the default value of `shell-prompt-pattern',
1023 "*If non-nil, try to discard garbage sent by remote shell.
1029 "*Alist specifying extra arguments to pass to the remote shell.
1031 matching the shell file name and ARGS is a string specifying the
1034 This variable is only used when Tramp needs to start up another shell
1036 shell from reading its init file."
1356 Because Tramp wants to parse the output of the remote shell, it is easily
1357 confused by ANSI color escape sequences and suchlike. Often, shell init
1362 (defcustom tramp-completion-without-shell-p nil
1363 "*If nil, use shell wildcards for completion, else rely on Lisp only.
1364 Using shell wildcards for completions has the advantage that it can be
1372 (defcustom tramp-actions-before-shell
1375 (shell-prompt-pattern tramp-action-succeed)
1376 (tramp-shell-prompt-pattern tramp-action-succeed)
1403 See `tramp-actions-before-shell' for more info."
1410 (shell-prompt-pattern tramp-multi-action-succeed)
1411 (tramp-shell-prompt-pattern tramp-multi-action-succeed)
1416 See `tramp-actions-before-shell' for more info."
1424 "List of commands to send to the first remote shell that we see.
1425 These commands will be sent to any shell, and thus they should be
1427 to the bare necessity for getting the remote shell into a state
1428 where it is possible to execute the Bourne-ish shell.
1430 At the moment, the command to execute the Bourne-ish shell uses strange
1661 we have this shell function.")
1913 "Whether to process echoes from the remote shell.")
1966 (shell-command . tramp-handle-shell-command)
2332 (tramp-shell-quote-argument localname)))))))
2375 (tramp-shell-quote-argument localname)))
2457 (tramp-shell-quote-argument localname) id-format))
2485 (tramp-shell-quote-argument localname)))
2536 (tramp-shell-quote-argument localname)))
2553 (tramp-shell-quote-argument localname))))
2579 ;; When the remote shell is started, it looks for a shell which groks
2602 ;; still try to run a shell command on the remote host.
2658 (tramp-shell-quote-argument localname))
2746 (concat "cd " (tramp-shell-quote-argument localname))
2750 (tramp-shell-quote-argument localname))
2769 ;; the remote shell for this would probably be way faster.
2801 (tramp-shell-quote-argument localname)
2832 (let* ((nowild tramp-completion-without-shell-p)
2837 (format "cd %s" (tramp-shell-quote-argument localname))
2840 (tramp-shell-quote-argument localname))
2854 (tramp-shell-quote-argument filename)))))
2913 (format "%s %s %s" ln (tramp-shell-quote-argument v1-localname)
2914 (tramp-shell-quote-argument v2-localname))
3104 (tramp-shell-quote-argument localname1)
3105 (tramp-shell-quote-argument localname2)))
3193 (tramp-shell-quote-argument v1-localname))))
3203 (tramp-shell-quote-argument v2-localname))))
3255 (tramp-set-process-query-on-exit-flag p nil)
3279 (tramp-shell-quote-argument localname))
3292 (tramp-shell-quote-argument localname)))
3303 (tramp-shell-quote-argument localname))))
3314 ;; run a shell command 'rm -r <localname>'
3322 (format "rm -r %s" (tramp-shell-quote-argument localname)))
3336 (format "cd %s" (tramp-shell-quote-argument localname))
3339 (tramp-shell-quote-argument localname))
3342 (mapconcat #'tramp-shell-quote-argument (cons program arguments) " "))
3358 (defun tramp-handle-dired-compress-file (file &rest ok-flag)
3465 (tramp-shell-quote-argument (concat localname ".")))))
3468 (format "cd %s" (tramp-shell-quote-argument
3472 (tramp-shell-quote-argument (file-name-directory localname)))
3482 (tramp-shell-quote-argument
3565 ;; Tilde expansion if necessary. This needs a shell which
3566 ;; groks tilde expansion! The function `tramp-find-shell' is
3567 ;; supposed to find such a shell on the remote host. Please
3635 Used in `tramp-handle-shell-command'")
3637 (defvar tramp-display-shell-command-buffer t
3638 "Whether to display output buffer of `shell-command'.
3641 (defun tramp-handle-shell-command (command &optional output-buffer error-buffer)
3642 "Like `shell-command' for tramp files.
3675 (format "cd %s" (tramp-shell-quote-argument localname))
3677 "tramp-handle-shell-command: Couldn't `cd %s'"
3678 (tramp-shell-quote-argument localname))
3750 (when tramp-display-shell-command-buffer
3756 (message "tramp-handle-shell-command called with non-tramp directory: `%s'"
3758 (tramp-run-real-handler 'shell-command
3767 (let ((tramp-display-shell-command-buffer display))
3768 (shell-command
3769 (mapconcat 'tramp-shell-quote-argument (cons program args) " ")
3814 (concat rem-enc " < " (tramp-shell-quote-argument localname))
4051 ;; talking to the remote shell or suchlike won't hose this
4139 (tramp-shell-quote-argument localname)))
4177 ;; from (buffer-file-name), f.e. if `file-precious-flag' is set.
4286 'dired-shell-unhandle-file-name 'dired-uucode-file
4320 'shell-command
4324 'dired-print-file 'dired-shell-call-process))
4397 "Invoke remote-shell Tramp file name handler.
5056 "Define in remote shell function NAME implemented as perl SCRIPT.
5100 (tramp-shell-quote-argument (tramp-file-name-localname v)))))))
5131 (tramp-shell-quote-argument localname1)
5133 (tramp-shell-quote-argument localname2))))))
5156 (tramp-shell-quote-argument localname))
5285 ;; -- communication with external shell --
5335 (defun tramp-find-shell (multi-method method user host)
5336 "Find a shell on the remote host which groks tilde expansion."
5337 (let ((shell nil))
5342 (setq shell
5347 (unless shell
5348 (error "Couldn't find a shell which groks tilde expansion"))
5349 ;; Find arguments for this shell.
5354 (when (string-match (car item) shell)
5356 (when extra-args (setq shell (concat shell " " extra-args))))
5358 5 "Starting remote shell `%s' for tilde expansion..." shell)
5361 (concat "PS1='$ ' exec " shell)) ;
5362 (tramp-barf-if-no-shell-prompt
5364 60 "Couldn't find remote `%s' prompt" shell)
5366 9 "Setting remote shell prompt...")
5378 9 "Setting remote shell prompt...done")
5434 ;; `tramp-actions-before-shell' for usage of these functions.
5454 "Signal success in finding shell prompt."
5455 (tramp-message 9 "Found remote shell prompt.")
5549 "Signal success in finding shell prompt."
5550 (tramp-message 9 "Found shell prompt on `%s'" host)
5569 "Wait for output from the shell and perform one action."
5572 (tramp-message 9 "Waiting 60s for prompt from remote shell")
5582 (tramp-message 10 "Looking for regexp \"%s\" from remote shell"
5594 (tramp-message 9 "Waiting for prompts from remote shell")
5611 "Wait for output from the shell and perform one action."
5614 (tramp-message 9 "Waiting 60s for prompt from remote shell")
5625 (tramp-message 10 "Looking for regexp \"%s\" from remote shell"
5635 (tramp-message 9 "Waiting for prompts from remote shell")
5644 ;; Functions to execute when we have seen the remote shell prompt but
5645 ;; before we exec the Bourne-ish shell. Note that these commands
5646 ;; might be sent to any shell, not just a Bourne-ish shell. This
5649 ;; please make sure that they at least don't crash the odd shell people
5659 (tramp-message 10 "Sending command to remote shell: %s"
5662 (tramp-barf-if-no-shell-prompt
5663 p 60 "Remote shell command failed: %s" cmd))
5677 Recognition of the remote shell prompt is based on the variables
5678 `shell-prompt-pattern' and `tramp-shell-prompt-pattern' which must be
5722 (tramp-set-process-query-on-exit-flag p nil)
5726 tramp-actions-before-shell 60)
5727 (tramp-open-connection-setup-interactive-shell
5735 password or shell prompt. If a password prompt is seen, the user is
5737 host and waits for a shell prompt.
5741 Recognition of the remote shell prompt is based on the variables
5742 `shell-prompt-pattern' and `tramp-shell-prompt-pattern' which must be
5795 (tramp-set-process-query-on-exit-flag p nil)
5799 tramp-actions-before-shell 60)
5800 (tramp-message 7 "Initializing remote shell")
5801 (tramp-open-connection-setup-interactive-shell
5812 Recognition of the remote shell prompt is based on the variables
5813 `shell-prompt-pattern' and `tramp-shell-prompt-pattern' which must be
5814 set up correctly. Note that the other user may have a different shell
5816 `shell-prompt-pattern' is set up wrongly!"
5857 (tramp-set-process-query-on-exit-flag p nil)
5860 tramp-actions-before-shell 60)
5861 (tramp-open-connection-setup-interactive-shell
5911 (tramp-set-process-query-on-exit-flag p nil)
5912 (tramp-message 9 "Waiting 60s for local shell to come up...")
5915 shell-prompt-pattern tramp-shell-prompt-pattern))
5918 (error "Couldn't find local shell prompt"))
5932 (tramp-open-connection-setup-interactive-shell
5942 Uses shell COMMAND to issue a `telnet' command to log in as USER to
5965 Uses shell COMMAND to issue an `rlogin' command to log in as USER to
5991 Uses shell COMMAND to issue a `su' command to log in as USER on
6066 (defun tramp-wait-for-shell-prompt (proc timeout)
6067 "Wait for the shell prompt to appear from process PROC within TIMEOUT seconds.
6069 Shell prompt pattern is determined by variables `shell-prompt-pattern'
6070 and `tramp-shell-prompt-pattern'."
6074 shell-prompt-pattern tramp-shell-prompt-pattern)))
6076 (defun tramp-barf-if-no-shell-prompt (proc timeout &rest error-args)
6077 "Wait for shell prompt and barf if none appears.
6078 Looks at process PROC to see if a shell prompt appears in TIMEOUT
6080 (unless (tramp-wait-for-shell-prompt proc timeout)
6114 (defun tramp-open-connection-setup-interactive-shell
6116 "Set up an interactive shell.
6117 Mainly sets the prompt and the echo correctly. P is the shell process
6146 (tramp-barf-if-no-shell-prompt
6151 (tramp-message 8 "Setting up remote shell environment")
6229 (tramp-message 9 "Setting shell prompt")
6244 "Prepare a remote shell before being able to work on it.
6246 Among other things, this finds a shell which groks tilde expansion,
6248 locale to C and sets up the remote shell search path."
6249 ;; Search for a good shell before searching for a command which
6257 (tramp-find-shell multi-method method user host)
6260 ;; output of (tramp-find-shell) to show up along with the output of
6264 ;; call in (tramp-find-shell) *should* make this not happen, I thought.
6293 ;; Tell remote shell to use standard time format, needed for
6311 ;; for otherwise the shell crashes.
6410 (tramp-shell-quote-argument magic-string) rem-enc rem-dec))
6566 tramp-encoding-shell ;program
6572 ;; actual shell command
6640 Sends COMMAND, then waits 30 seconds for shell prompt."
6644 (tramp-barf-if-no-shell-prompt
6962 (defun tramp-shell-case-fold (string)
6963 "Converts STRING to shell glob pattern which ignores case."
7400 (defun tramp-set-process-query-on-exit-flag (process flag)
7402 If the second argument flag is non-nil, Emacs will query the user before
7405 (if (fboundp 'set-process-query-on-exit-flag)
7406 (symbol-function 'set-process-query-on-exit-flag)
7408 process flag))
7415 ;; Currently (as of Emacs 20.5), the function `shell-quote-argument'
7418 ;; is passed to a shell, the shell will expand this into "ab",
7421 ;; `shell-quote-argument' work with newlines without making it
7422 ;; dependent on the shell used. But within this package, we know that
7423 ;; we will always use a Bourne-like shell, so we use an approach which
7426 ;; The approach is simple: we call `shell-quote-argument', then
7430 ;; shell, even if the Emacs is running on Windows. Since this is the
7432 ;; `shell-quote-arguments' behaves as if on Unix.
7438 ;; `shell-quote-argument' is not used. This way, we are safe from
7439 ;; changes in `shell-quote-argument'.
7440 (defun tramp-shell-quote-argument (s)
7441 "Similar to `shell-quote-argument', but groks newlines.
7445 (let ((result (shell-quote-argument s))
7559 tramp-actions-before-shell
7564 (tramp-shell-prompt-pattern . tramp-reporter-dump-variable)
7573 (shell-prompt-pattern . tramp-reporter-dump-variable)
7776 ;; a shell program which contains only "safe" ascii characters
7789 ;; * Rewrite `tramp-shell-quote-argument' to abstain from using
7790 ;; `shell-quote-argument'.
7813 ;; * Do asynchronous `shell-command's.
7815 ;; * Test remote ksh or bash for tilde expansion in `tramp-find-shell'?
7838 ;; * Implement asynchronous shell commands.