{"id":22473133,"url":"https://github.com/bas080/dotlocaldotbashrc","last_synced_at":"2025-07-23T04:34:44.442Z","repository":{"id":212887408,"uuid":"732537626","full_name":"bas080/dotlocaldotbashrc","owner":"bas080","description":".local .bashrc files that are sourced in a clean bash process on directory enter.","archived":false,"fork":false,"pushed_at":"2024-01-04T19:59:00.000Z","size":35,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-04T13:48:56.612Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bas080.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-17T02:14:41.000Z","updated_at":"2024-10-16T20:38:19.000Z","dependencies_parsed_at":"2023-12-20T15:43:43.606Z","dependency_job_id":null,"html_url":"https://github.com/bas080/dotlocaldotbashrc","commit_stats":null,"previous_names":["bas080/dotbashrc","bas080/dotlocaldotbashrc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bas080/dotlocaldotbashrc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bas080%2Fdotlocaldotbashrc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bas080%2Fdotlocaldotbashrc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bas080%2Fdotlocaldotbashrc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bas080%2Fdotlocaldotbashrc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bas080","download_url":"https://codeload.github.com/bas080/dotlocaldotbashrc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bas080%2Fdotlocaldotbashrc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266618862,"owners_count":23957273,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-06T12:19:20.742Z","updated_at":"2025-07-23T04:34:44.425Z","avatar_url":"https://github.com/bas080.png","language":"Shell","readme":"# 👇local👇bashrc\n\n`.local.bashrc` files that are sourced in a clean bash process when entering\nthe directory.\n\n*Replaces the [projector](https://github.com/bas080/projector) project.*\n\n## Features\n\n- Makes a simple to define env variables, aliases and functions for a specific\n  project directory.\n- Creates a bash history that is a separate from the root bash history.\n  - Makes it easier to keep and find commands that are related to that project.\n  - Doesn't fill up the root bash history.\n- Does not inherit env variables of other `.local.bashrc` directories when\n  jumping directories.\n- Comes with an `lcd` alias to quickly jump to `.local.bashrc` directory\n\n## Setup\n\nA quick setup script.\n\n```bash\ncurl 'https://raw.githubusercontent.com/bas080/dotlocaldotbashrc/master/dotlocaldotbashrc' \u003e \"$HOME/.dotlocaldotbashrc\" \u0026\u0026\n  echo 'source \"$HOME/.dotlocaldotbashrc\"' \u003e\u003e ~/.bashrc\n```\n\nAfter re-sourcing your .bashrc you can create a `.local.bashrc` in a directory where you would like\na local bashrc by running `dotlocaldotbashrc init`.\n\nOptionally you can show which local bashrc is currently active in your prompt.\n\n```bash\n# What I use:\nPS1=\"${BASHRC_HOME#$HOME/}:\\W \"\n\n# Looks like this:\nprojects/dotlocaldotbashrc:dotlocaldotbashrc cd ../█\n```\n\nWhen using in repositores consider adding `.local.*` to your `.gitignore`.\n\n## Usage\n\nQuick start:\n\n```text\ndotlocaldotbashrc [\u003csubcommand\u003e]\n  Create and configure directory specific bash sessions.\n\n  Will source .local.bashrc when no subcommand is defined.\n\n  [subcommand]\n    init - Create a .local.bashrc in current directory.\n    edit - Opens the bashrc in $EDITOR and re-sources on exit.\n```\n\nMore information:\n\n```\n$ cd projects/bashrc/\ndotlocaldotbashrc: open /home/user/projects/bashrc\n$ cd nested/\ndotlocaldotbashrc: exit /home/user/projects/bashrc\ndotlocaldotbashrc: open /home/user/projects/bashrc/nested\n$ cd\ndotlocaldotbashrc: exit /home/user/projects/bashrc/nested\n$\n```\n\n\u003e Notice that navigating to the home directory resulted in only a bashrc bash\n\u003e session being exited. We just use the initial bash process that was started\n\u003e when bashrc and the rest of the interactive shell was bootstrapped.\n\nYou can source the local .local.bashrc at anytime with `dotlocaldotbashrc` function.\n\n```bash\n$ dotlocaldotbashrc\nbashrc: source '/home/user/.local.bashrc'\n$\n```\n\nYou can quickly edit and automatically source after editor quit with\n`dotlocaldotbashrc edit`.\n\nOne notable feature of `dotlocaldotbashrc` is its behavior when background jobs\nare active. When attempting to exit the `dotlocaldotbashrc` session using the\n`cd` command or when explicitly running the `dotlocaldotbashrc` command with the\n`exit` option, the script checks for any background jobs in the current session.\n\nIf there are background jobs running, the script will display an error message\nand refrain from exiting the session. This behavior ensures that you don't\nunintentionally lose work by exiting a session with active background jobs.\n\n```bash\n$ cd projects/myproject/\ndotlocaldotbashrc: open /home/user/projects/myproject\n\n# Start a background job\n$ sleep 300 \u0026 # ctrl-z\n[1] 12345\n\n# Attempt to exit the dotlocaldotbashrc session\n$ cd ..\ndotlocaldotbashrc: error: will not exit with jobs in the background.\n```\n\n## Test\n\nHow to run the tests:\n\n```bash\nSPAT_SHELL='bash' spat ./dotlocaldotbashrc.t\n```\n\n\u003e Uses [spat](https://github.com/bas080/spat) to run expect tests.\n\n## License\n\nGPLv3\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbas080%2Fdotlocaldotbashrc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbas080%2Fdotlocaldotbashrc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbas080%2Fdotlocaldotbashrc/lists"}