Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bashmarks Issues Saving Directories #50

Closed
McPrescott opened this issue Apr 23, 2019 · 2 comments · Fixed by #127
Closed

Bashmarks Issues Saving Directories #50

McPrescott opened this issue Apr 23, 2019 · 2 comments · Fixed by #127
Labels
bug-report Issues about bug reporting help-wanted Issues that require help from third party P3 - Normal Priority 3 - Normal

Comments

@McPrescott
Copy link

Upon installation, the bashmarks plugin has been behaving incorrectly in strange ways; strange enough that actually showing the behavior will be much easier than attempting to use prose exclusively.

In the following screenshot, bashmarks begins with no bookmarks. As is demonstrated, when bashmarks has one or more bookmarks saved, a cannot overwrite existing file message is shown.

ohmybash oh-my-bash 01

Attempting as best I can to describe the incorrect behavior observed:

  1. A cannot overwrite existing file error message is shown when saving a
    bookmark with one or more existing bookmarks.
  2. The home bookmark is either never saved, or is deleted for an unknown
    reason.
  3. After saving home for the second time, the behavior seems to normalize,
    sauf the aforementioned error message.

There are however, more issues. I've encountered another after starting a new instance of bash; this time the media bookmark is deleted.

ohmybash oh-my-bash 02

Based on these observations, it seems that the issue is related to the implementation of bookmark saving, especially that involving the temporary files (/tmp/bashmarks.6oXbma, /tmp/bashmarks.kJ0zFh, et cetera, in the examples provided).

@nntoan nntoan added bug-report Issues about bug reporting help-wanted Issues that require help from third party up for grabs labels May 9, 2019
@idavydov
Copy link

idavydov commented Jul 1, 2019

I think it's because you have set -C in your .bashrc file.

With this flag bash won't overwrite an existing file.

In the function _purge_line I have corrected this line:

        # purge line
        sed "/$2/d" "$1" > "$t"

To this (note an extra | character):

        # purge line
        sed "/$2/d" "$1" >| "$t"

And it seems to work for me.

@jasonverbeek
Copy link
Contributor

jasonverbeek commented Feb 5, 2020

the issue is in lib/shopt.sh.
It contains set -o noclobber which prevents overwriting files using > unless you replace it with >|.

Bashmark probably uses > in their script to write updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Issues about bug reporting help-wanted Issues that require help from third party P3 - Normal Priority 3 - Normal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants