* eat.el (eat--inhibit-prompt-mode): New variable.
* eat.el (eat--post-prompt, eat--post-cont-prompt): Check
'eat--inhibit-prompt-mode' before switching to prompt mode.
* eat.el (eat--before-new-prompt): New function.
* eat.el (eat--handle-uic): Support "before new prompt"
sequence.
* eat.el (eat-emacs-mode, eat-semi-char-mode, eat-char-mode):
Set 'eat--inhibit-prompt-mode' to t if prompt mode is enabled.
* eat.el (eat-mode): Make 'eat--inhibit-prompt-mode'
buffer-local.
* integration/bash (__eat_prompt_command):
* integration/zsh (__eat_precmd):
Send the "before new prompt" sequence.
* eat.el (eat--get-shell-history): New argument FORMAT, pass it
to 'eat--prompt-populate-input-ring'.
* eat.el (eat--handle-uic): Accept FORMAT argument in input
history reporting sequence and pass it to
'eat--get-shell-history'.
* eat.el (eat--prompt-populate-input-ring): New argument
FORMAT. Support Zsh extended history file format.
* integration/bash (__eat_enable_integration): Send "bash" as
the history file format.
* integration/zsh (__eat_enable_integration): Send shell
history.
* eat.el (eat-enable-native-shell-prompt-editing)
(eat-prompt-input-ring-size)
(eat-prompt-move-point-for-matching-input): New user option.
* eat.el (eat--t-term): Remove slots 'cwd', 'prompt-start-fn',
'prompt-end-fn', 'cont-prompt-start-fn', 'cont-prompt-end-fn',
'cmd-start-fn' and 'cmd-finish-fn'. Add new slot 'ui-cmd-fn'.
* eat.el (eat--t-set-cwd): Support only the format used by OSC
7.
* eat.el (eat--t-prompt-start, eat--t-prompt-end)
(eat--t-cont-prompt-start, eat--t-cont-prompt-end)
(eat--t-set-cmd, eat--t-cmd-start, eat--t-cmd-finish): Remove
function.
* eat.el (eat--t-ui-cmd): New function.
* eat.el (eat--t-handle-output): Remove all specialized OSC 51
handlers and call 'eat--t-ui-cmd' to handle any OSC 51
sequence.
* eat.el (eat-term-set-parameter): Set 'ui-cmd-fn' slot of
terminal when 'ui-command-function' is set.
* eat.el (eat-term-cwd): Remove function.
* eat.el (eat-term-prompt-start-function)
(eat-term-prompt-end-function, eat-term-cmd-start-function)
(eat-term-cont-prompt-start-function)
(eat-term-cont-prompt-end-function, eat-term-set-cmd-function)
(eat-term-cmd-finish-function): Remove generalized variables.
* eat.el (eat-term-send-string): New function.
* eat.el (eat-send-string-as-yank): Rename to
'eat-term-send-string-as-yank'.
All callers changed.
* eat.el (eat--set-cwd-uic, eat--post-cont-prompt): New
function.
* eat.el (eat--pre-prompt, eat--post-prompt, eat--set-cmd)
(eat--pre-cmd, eat--set-cmd-status): Remove unused first
argument.
All callers changed.
* eat.el (eat--get-shell-history, eat--handle-uic): New
function.
* eat.el (eat-prompt-mode-map): New variable.
* eat.el (eat-emacs-mode, eat-semi-char-mode, eat-char-mode):
Handle the case when prompt mode is active.
* eat.el (eat--prompt-mode-previous-mode): New variable.
* eat.el (eat--prompt-mode): New non-interactive minor mode.
* eat.el (eat-prompt-send-default, eat-prompt-send)
(eat-prompt-newline, eat-prompt-delchar-or-eof)
(eat-prompt-send-interrupt): New command.
* eat.el (eat--prompt-input-ring, eat--prompt-input-ring-index)
(eat--prompt-stored-incomplete-input)
(eat--prompt-matching-input-from-input-string): New variable.
* eat.el (eat--prompt-populate-input-ring)
(eat--prompt-reset-input-ring-vars, eat--prompt-ask-for-regexp-arg)
(eat--prompt-search-arg, eat--prompt-search-start)
(eat--prompt-prev-input-string, eat--prompt-prev-matching-input-str)
(eat--prompt-delete-input, eat--prompt-prev-matching-input-str-pos):
New function.
* eat.el (eat-prompt-previous-input, eat-prompt-next-input)
(eat-prompt-restore-input, eat-prompt-previous-matching-input)
(eat-prompt-next-matching-input, eat-prompt-find-input)
(eat-prompt-previous-matching-input-from-input)
(eat-prompt-next-matching-input-from-input): New command.
* eat.el (eat-mode): Make 'eat--prompt-mode-previous-mode',
'eat--prompt-input-ring', 'eat--prompt-input-ring-index',
'eat--prompt-stored-incomplete-input' and
'eat--prompt-matching-input-from-input-string' buffer-local.
Record undo information if
'eat-enable-native-shell-prompt-editing' is enabled. Set
'mode-line-process' properly so that prompt mode is shown when
enabled.
* eat.el (eat--process-output-queue): Remove any narrowing
temporarily when called. Don't
* eat.el (eat--sentinel): Disable prompt mode. Also fix the
bug where the point centers when the program exits, instead of
going to the end of buffer.
* eat.el (eat-exec): Don't set removed generalized variables
'eat-term-prompt-start-function', 'eat-term-set-cmd-function',
'eat-term-prompt-end-function', 'eat-term-cmd-start-function'
and 'eat-term-cmd-finish-function'. Set terminal parameter
'ui-command-function' to 'eat--handle-uic'.
* eat.el (eat--eshell-handle-uic): New function.
* eat.el (eat--eshell-output-filter): Let-bind
'inhibit-read-only' only for required parts.
* eat.el (eat--eshell-setup-proc-and-term): Set terminal
parameter 'ui-command-function' to 'eat--eshell-handle-uic'.
* eat.el (eat--eshell-sentinel): Fix the bug where the point
centers when the program exits, instead of going to the end of
buffer.
* integration/bash (__eat_enable_integration): Send shell
history.
* integration/bash (__eat_current_command, __eat_exit_status)
(__eat_inhibit_preexec): Move to '__eat_enable_integration'.
* integration/bash (__eat_prompt_start, __eat_prompt_end)
(__eat_continuation_start, __eat_continuation_end): Move to
'__eat_enable_integration' and make local there.
* eat.el (eat--t-term): New slots: 'prompt-start-fn',
'prompt-end-fn', 'cont-prompt-start-fn', 'cont-prompt-end-fn',
'set-cmd-fn', 'cmd-start-fn', 'cmd-finish-fn'
* eat.el (eat--t-set-cwd): Accept three arguments in two
different formats.
* eat.el (eat--t-prompt-start, eat--t-prompt-end)
(eat--t-cont-prompt-start, eat--t-cont-prompt-end)
(eat--t-set-cmd, eat--t-cmd-start, eat--t-cmd-finish): New
function.
* eat.el (eat--t-handle-output): Accept Eat's own
OSC 51 ; e ; ... ST sequences.
* eat.el (eat-term-prompt-start-function)
(eat-term-prompt-end-function)
(eat-term-continuation-prompt-start-function)
(eat-term-continuation-prompt-end-function)
(eat-term-set-cmd-function, eat-term-cmd-start-function)
(eat-term-cmd-finish-function): New generalized variable.
* integration/bash (__eat_current_command, __eat_exit_status):
New variable.
* integration/bash (__eat_prompt_command): Send exit status of
last command, if applicable. Use Eat specific sequence to
report working directory. Set title.
* integration/bash (__eat_preexec): Report current command and
execution start.
* integration/bash (__eat_before_prompt_command): Set
'__eat_exit_status' to the exit status of the last command.
* integration/bash (__eat_prompt_start, __eat_prompt_end)
(__eat_continuation_start, __eat_continuation_end): New
variable, used as constant only to make the code more readable.
* integration/bash (__eat_enable_integration): Wrap 'PS1' and
'PS2'. Don't set title from 'PS1'.
* integration/bash (__eat_in_prompt_command): Rename to
'__eat_inhibit_preexec'.
* integration/bash (__eat_before_exec): Inhibit further
'__eat_preexec' calls until next prompt.
* integration/bash (__eat_preexec): Use 'history' to get the
real command typed by the user.
* integration/bash (__eat_prompt_command): Remove extra '\'s.
* integration/bash (__eat_in_prompt_command): New variable.
* integration/bash (__eat_preexec, __eat_before_prompt_command)
(__eat_after_prompt_command, __eat_before_exec): New function.
* integration/bash: Modify PS1 to update terminal title when
displaying prompt. Add '__eat_before_exec' as 'DEBUG' trap
handler to update terminal title just before executing a
command. Prepend and append '__eat_before_prompt_command' and
'__eat_after_prompt_command' to 'PROMPT_COMMAND' to avoid
getting trapped in 'DEBUG' trap.
* integration/bash: New file.
* eat.el (eat-term-shell-integration-directory): New variable.
Contains path to the directory containing the scripts,
automatically updated when Eat is updated.
* eat.el (eat-exec, eat-eshell-mode): New enviroment variable
'EAT_SHELL_INTEGRATION_DIR'.
* eat.texi (Shell Integration): New chapter.
* eat.texi (Directory Tracking): Refer to 'Shell Integration'.