DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 3 Weeks Ago
Prevet Prevet is offline
Shell Scout
 
Join Date: Oct 2017
Posts: 98
Default Ranger file manager deleted home directory

This has happened to me twice now. I want to remove a single file so I type :del followed by the Tab key, Ranger asks if I want to delete the home directory, then muscle memory takes over and my account is nuked.

Both times it happened when I was in a subdirectory. I am not sure if it is a bug, or a missed key press because it occurs so rarely.

I've since dropped Ranger and am now using Noice, so this post is more of a warning for anyone who is using Ranger. I am also thinking it might be a good idea to have a waste paper bin in OpenBSD.
Reply With Quote
  #2   (View Single Post)  
Old 3 Weeks Ago
victorvas victorvas is offline
Real Name: Victor
Port Guard
 
Join Date: May 2019
Posts: 19
Default

Try nnn file browser (nnn-1.8.tgz), it's the best!
Reply With Quote
  #3   (View Single Post)  
Old 3 Weeks Ago
sacerdos_daemonis's Avatar
sacerdos_daemonis sacerdos_daemonis is offline
Real Name: Will forever be a secret.
Spam Deminer
 
Join Date: Sep 2014
Posts: 231
Default

Midnight Commander commands also work with Ranger. Useful if one occasionally mistypes.

F8 = delete
F7 = create directory
et cetera
Reply With Quote
  #4   (View Single Post)  
Old 3 Weeks Ago
GarryR's Avatar
GarryR GarryR is offline
Real Name: Garry Ricketson
parrot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 343
Default

Quote:
I am also thinking it might be a good idea to have a waste paper bin in OpenBSD.
There are ways to make back up copies of files and directories, and you can set up your system to do it automatically, for example:
Code:
:w Input_file_bkp
before editing.
Or, for example, BEFORE blindly clicking or typing the delete option, and then saying yes, when it tries to warn you,...
Code:
mv foodir foodir-trsh
Will move the directory "foodir" to a directory "foodir-trsh", which could be in a directory name "waste-bucket".
Code:
mv foodir  /home/anyuser/waste-bucket/foodir-trsh
====== edited =======
I am not sure this can be applied to OpenBsd, I think it could be, the main point is ranger can be configured to move the directory or files to a trash dir, (waste paper) :
Quote:
from: https://wiki.archlinux.org/index.php/Ranger
Move to trash

To add a keybind that moves files to your trash directory ~/.local/share/Trash/files/ with DD, add to ~/.config/ranger/rc.conf:
Code:
map DD shell mv %s /home/${USER}/.local/share/Trash/files/
Myself, I avoid using any GUI file managers when using the console, for the obvious reasons, as what happend to the OP, it is to easy to make a mistake, and delete something one does not want to delete. Also, I think if one must have a file manger when using the console or for example when accessing via ssh, well MC would be a better choice, in my opinion.
Quote:
so this post is more of a warning for anyone who is using Ranger.
Saying yes, after the file manager tries to warn you and asks if you are sure you want to delete a directory, is not a bug, it does what it says it will, when you say yes. I have made the same mistake myself but using other file managers , so the warning should be applied to any GUI file manager.
__________________
My best friends are parrots

Last edited by GarryR; 3 Weeks Ago at 06:00 PM. Reason: added some comments
Reply With Quote
  #5   (View Single Post)  
Old 3 Weeks Ago
Prevet Prevet is offline
Shell Scout
 
Join Date: Oct 2017
Posts: 98
Default

Thanks for the help everyone. There's some good tips here.
Reply With Quote
  #6   (View Single Post)  
Old 3 Weeks Ago
GarryR's Avatar
GarryR GarryR is offline
Real Name: Garry Ricketson
parrot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 343
Default

Quote:
Originally Posted by victorvas View Post
Try nnn file browser (nnn-1.8.tgz), it's the best!
I just now tried nnn, seems pretty neat, I like it. Thanks
__________________
My best friends are parrots
Reply With Quote
  #7   (View Single Post)  
Old 3 Weeks Ago
fvgit's Avatar
fvgit fvgit is offline
Tempvs fvgit
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("SGVyZSBiZSBkcmFnb25zC")'
Posts: 159
Default

For what it's worth, I tried ranger last year (I think) as a self compiled binary on an outdated OpenBSD installation that had no port. As neat as it looks on first impression I found it too unstable randomly crashing. Perhaps it's because I have an entire rabbit hole of directories under $HOME that goes really deep down. Anyway, it didn't seem to me to be the kind of programme I'd trust essential file operations with.

My 2¢
Reply With Quote
  #8   (View Single Post)  
Old 3 Weeks Ago
victorvas victorvas is offline
Real Name: Victor
Port Guard
 
Join Date: May 2019
Posts: 19
Default

Quote:
Originally Posted by fvgit View Post
For what it's worth, I tried ranger last year (I think) as a self compiled binary on an outdated OpenBSD installation that had no port. As neat as it looks on first impression I found it too unstable randomly crashing. Perhaps it's because I have an entire rabbit hole of directories under $HOME that goes really deep down. Anyway, it didn't seem to me to be the kind of programme I'd trust essential file operations with.

My 2¢
ranger is written in python, so... it's pretty good for what it is
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to backup the home directory kerasi OpenBSD General 3 15th November 2017 08:36 AM
Using rsync to synchronize or mirror your home directory files to an USB stick J65nko Guides 8 1st January 2014 08:55 PM
strange "~" directory in home directory gosha OpenBSD General 5 23rd February 2009 06:12 PM
FTP users sharing same home directory phreud FreeBSD General 6 11th November 2008 10:11 PM
Jails - mount: /usr/home: No such file or directory chris FreeBSD General 6 6th August 2008 10:47 PM


All times are GMT. The time now is 05:00 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick