* eat.el (eat--eshell-adjust-make-process-args): Override
'start-file-process' on Emacs 28, used by Eshell on Emacs 28.
Don't override 'make-process' on Emacs 28, Eshell doesn't use
that on Emacs 28. Set process filter and sentinel in
'eshell-exec-hook' instead of 'make-process' advice.
* eat.el (eat-yank): Use simpler, saner and better approach to get the
yanked string instead of the previous stupid, insane and buggy
approach.
* eat.el (eat-yank-pop): Remove, because it's not cancel the text
already sent to the terminal.
* eat.el (eat-yank-from-kill-ring): New function. Behaves essentially
the same the previous (not properly working) 'eat-yank-pop'.
* eat.el (eat-semi-char-mode-map, eat-eshell-semi-char-mode-map):
Replace 'eat-yank-pop' with 'eat-yank-from-kill-ring'.
* eat.el (eat--t-term): New slot: 'params'.
* eat.el (eat-term-parameter): New function and generalized
variable.
* eat.el (eat-set-term-parameter): New function.
* eat.el (eat--t-report-foreground-color): Fix foreground color
reporting in text terminals.
* eat.el (eat--t-report-background-color): Fix background color
reporting in text terminals.
When giving more than two arguments to 'setq', it becomes hard
to figure out what is assigned to what. As the number of
argument increases, the readablity of code decreases. This is
also true for 'setq-local'. For 'setf', the problem is even
greater, unlike 'setq', all arguments to 'setf' look the same.
* eat.el (eat--t-reset, eat--t-write, eat--t-save-cur)
(eat--t-restore-cur, eat--t-enable-alt-disp)
(eat--t-disable-alt-disp, eat--t-change-scroll-region)
(eat--t-set-sgr-params, eat--t-manipulate-selection)
(eat--t-resize, eat--blink-start-timers, eat-blink-mode)
(eat--cursor-blink-mode, eat--set-cursor, eat-self-input)
(eat-mode, eat-exec, eat--eshell-setup-proc-and-term)
(eat--eshell-cleanup, eat--eshell-adjust-make-process-args)
(eat--eshell-local-mode, eat--eshell-exec-visual)
(eat--trace-exec, eat--trace-eshell-adjust-make-process-args)
(eat--trace-replay-eval, eat-trace-replay, eat-trace--cleanup):
Break combined 'setq'/'setf'/'setq-local's.
* eat.el (eat--eshell-setup-proc-and-term): Don't set
'eat--eshell-invocation-directory'.
* eat.el (eat--eshell-update-cwd): New function.
* eat.el (eat--eshell-local-mode): Call
'eat--eshell-update-cwd' when enabling the mode and add it to
'eshell-directory-change-hook' to keep track of Eshell's
working directory.
* eat.el (eat--correct-shell-prompt-mark-overlays): Make sure
'eat--terminal' is non-nil.
* eat.el (eat--sentinel): Cancel timers, correct shell prompt
annotations for the final time, reset shell prompt annotation
related local variables.
* 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.texi (Shell Integration): Move to be the first chapter of
Part III. Document everything about shell integration.
* eat.texi (Directory Tracking): Merge with the node 'Shell
Integration'.
* eat.el (eat--post-prompt): Add special text property on the
last character of shell prompt.
* eat.el (eat-previous-shell-prompt, eat-next-shell-prompt):
New command.
* eat.el (eat-mode-map): Bind 'eat-previous-shell-prompt' and
'eat-next-shell-prompt' to 'C-c C-p' and 'C-c C-n'
respectively.
* eat.el (eat-enable-shell-command-history): New user option.
* eat.el (eat--set-cmd): New function.
* eat.el (eat-exec, eat--eshell-setup-proc-and-term): Call
'eat--set-cmd' when the shell reports the command being run.
* 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'.
* eat.el (eat-exec, eat--eshell-setup-proc-and-term)
(eat--eshell-adjust-make-process-args)
(eat--eshell-synchronize-scroll): Calculate the number of
available lines on window properly.
* 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'.