Edit .inputrc

  • Hello,


    I would like to edit my .inputrc (to add home key, End key...)
    When I want to edit the file
    .initrc (in the home directory) I see that.


    Code
    # This file is auto-generated by openmediavault (https://www.openmediavault.org)
    # WARNING: Do not edit this file, your changes will get lost.
    
    
    "\C-[OA": history-search-backward
    "\C-[[A": history-search-backward
    "\C-[OB": history-search-forward
    "\C-[[B": history-search-forward


    Of course when I change the .initrc file it works but on the next restart it is lost.
    Can you please tell me how I can edit the file?
    Thank you
    Marc

    • Offizieller Beitrag

    I assume you are trying to edit root's inputrc? OMV does maintain that but you should be editing a user's initrc and using sudo. As with editing any config file owned by OMV, it will be overwritten - see problem #8 - https://forum.openmediavault.o…tions-to-common-problems/

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    So there is no way to tell omv to use another default file? (the point 8 only says not to do it)?

    Nope. I would've suggested a way if it was possible. The only way it can be done is changing OMV code - https://github.com/openmediava…/shell/20root_inputrc.sls which will be overwritten with each update. Why again are you setting defaults for root? To tell you the truth, I don't know why OMV is managing them either.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    In fact I only do tty for administrative tasks and to avoid doing sudo everytime i connect as root. but it is correct that I should use sudo (or su) more often.

    You can su or sudo su to root and use your profile settings...

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I really miss my own custom bash settings when logged on as root on my own machine.


    As a workaround I've put in to /root/.bashrc bind commands to get the behaviour I want


    e.g. to be able to search my history backwards on press of Page-Up I have


    Code
    bind '"\e[5~": history-search-backward'

    Update

    I've just noticed that the Anacron job 'cron.weekly' will email you a warning if you make this change.

    Code
    /etc/cron.weekly/openmediavault-update-smart-drivedb:
    /root/.bashrc: line 30: bind: warning: line editing not enabled


    To prevent that warning we could use

    Code
    # Rest of script above
    
    # https://www.gnu.org/software/bash/manual/bash.html#Is-this-Shell-Interactive_003f
    if [ -z "$PS1" ]; then
        # This shell is not interactive
        :
    else
        # This shell is interactive
        bind '"\e[5~": history-search-backward'
    fi

    Einmal editiert, zuletzt von spigs () aus folgendem Grund: Correction.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!