Skip to content

Commit

Permalink
ajump_exit() called from bash exit command so that closing the shell …
Browse files Browse the repository at this point in the history
…saves the time spent in that last used directory. This is often the most important directory (you navigate there and stay there for the whole of your session) so it makes sense to implement this.

Closes GH-2
  • Loading branch information
phill authored and phill committed May 14, 2009
1 parent 9524a13 commit 70d9799
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ajump.def
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Bash. If not, see <http://www.gnu.org/licenses/>.

#define AJUMP_DEF

$PRODUCES ajump.c

$BUILTIN j
Expand Down
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ popd
echo "patching builtins/common.c"
patch bash-4.0/builtins/common.c common.c.patch

echo "patching builtins/exit.def"
patch bash-4.0/builtins/exit.def exit.def.patch

echo "patching builtins/Makefile.in"
patch bash-4.0/builtins/Makefile.in Makefile.in.patch


pushd "bash-4.0"

./configure "$CONFIG_OPTIONS"
Expand Down
22 changes: 22 additions & 0 deletions exit.def.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- /tmp/bj/bash-4.0/builtins/exit.def 2009-01-04 19:32:22.000000000 +0000
+++ bash-4.0/builtins/exit.def 2009-05-14 22:04:29.000000000 +0100
@@ -46,6 +46,10 @@
#include "common.h"
#include "builtext.h" /* for jobs_builtin */

+#if defined (AJUMP_DEF)
+ #include "ajump.def"
+#endif
+
extern int check_jobs_at_exit;
extern int last_command_exit_value;
extern int running_trap, trap_saved_exit_value;
@@ -66,6 +70,8 @@
fflush (stderr);
}

+ ajump_exit();
+
return (exit_or_logout (list));
}

0 comments on commit 70d9799

Please sign in to comment.