34 lines
1 KiB
Text
34 lines
1 KiB
Text
# integration/bash --- Bash integration
|
|
|
|
# Copyright (C) 2022 Akib Azmain Turja.
|
|
|
|
# This file is not part of GNU Emacs.
|
|
|
|
# This file is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 3, or (at your option)
|
|
# any later version.
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
|
|
# For a full copy of the GNU General Public License
|
|
# see <https://www.gnu.org/licenses/>.
|
|
|
|
__eat_prompt_command () {
|
|
# Send the current working directory, for directory tracking.
|
|
printf "\\e]7;file://%s%s\\e\\\\" "$HOSTNAME" "$PWD"
|
|
}
|
|
|
|
# Add '__eat_prompt_command' as the last element of 'PROMPT_COMMAND'.
|
|
if test -z "$__eat_bash_integration_enabled"
|
|
then
|
|
__eat_bash_integration_enabled=yes
|
|
PROMPT_COMMAND+=(__eat_prompt_command)
|
|
fi
|
|
|
|
# Local Variables:
|
|
# mode: sh
|
|
# End:
|