Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Are pasted commands not remembered?

  1. #1
    Join Date
    Dec 2007
    Location
    Bombay
    Beans
    5,480
    Distro
    Lubuntu 14.04 Trusty Tahr

    Are pasted commands not remembered?

    I'm using Lubuntu 13.04 which comes with lxterminal.

    I get the impression that if I paste a command into lxterminal and run it by hitting enter and then subsequently close lxterminal (all instances), this command is not available (by using the up arrow) when I restart lxterminal.

    If I type in the command, there's no problem in reusing the command later on with the up arrow.

    I also don't see the pasted command in .bash_history.
    de gustibus et coloribus non est disputandum -- Wiktionary

  2. #2
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    7,051

    Re: Are pasted commands not remembered?

    This is strange, probably a bug. What happens if you run

    Code:
    sync
    before closing the terminal window?

  3. #3
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    7,051

    Re: Are pasted commands not remembered?

    I checked, and is not like that for me in an installed instance of Raring 32-bit.

    What I have noticed is that if I reboot or poweroff from a terminal window, the last session's commands will not be saved unless I sync before. I'm not sure if it is always or with some particular version, but I have noticed it, so when you have a similar issue, I want to mention it.

  4. #4
    Join Date
    Jan 2009
    Location
    ::1
    Beans
    2,460

    Re: Are pasted commands not remembered?

    Quote Originally Posted by vasa1 View Post
    I'm using Lubuntu 13.04 which comes with lxterminal.

    I get the impression that if I paste a command into lxterminal and run it by hitting enter and then subsequently close lxterminal (all instances), this command is not available (by using the up arrow) when I restart lxterminal.

    If I type in the command, there's no problem in reusing the command later on with the up arrow.

    I also don't see the pasted command in .bash_history.
    If there is a space at the beginning of the line, it will not be in history. Could that be the cause?

  5. #5
    Join Date
    Dec 2007
    Location
    Bombay
    Beans
    5,480
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: Are pasted commands not remembered?

    @sanderj, I checked and there is no space at the start.

    @sudodus, I think you have something there! If I close the terminal but don't log off, I can recall the command. I'll log off and try. Then, I'll also try your sync trick.
    de gustibus et coloribus non est disputandum -- Wiktionary

  6. #6
    Join Date
    Dec 2007
    Location
    Bombay
    Beans
    5,480
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: Are pasted commands not remembered?

    The command is remembered after a log-out, log-in! I'll try with a shutdown later in the day. Or maybe I just goofed in some way
    de gustibus et coloribus non est disputandum -- Wiktionary

  7. #7
    Join Date
    Dec 2007
    Location
    Bombay
    Beans
    5,480
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: Are pasted commands not remembered?

    @sudodus, can there be any bad effects to running sync in the context you describe?
    de gustibus et coloribus non est disputandum -- Wiktionary

  8. #8
    Join Date
    May 2009
    Location
    Fareham, UK
    Beans
    Hidden!
    Distro
    Xubuntu 13.04 Raring Ringtail

    Re: Are pasted commands not remembered?

    I've noticed similar behaviour when running two terminals at the same time, I find that only commands entered into one of the two terminals are logged in .bash_history perhaps the first one open get precedence???
    Catch me on Freenode - imark

  9. #9
    Join Date
    Dec 2007
    Location
    Bombay
    Beans
    5,480
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: Are pasted commands not remembered?

    Quote Originally Posted by CaptainMark View Post
    I've noticed similar behaviour when running two terminals at the same time, I find that only commands entered into one of the two terminals are logged in .bash_history perhaps the first one open get precedence???
    That's interesting!
    Meanwhile, just with the one terminal open, I couldn't reproduce my complaint even after a restart. So it's possible that having two terminals open had something to do with it. And then it shouldn't be just pasted commands but any command. But that should be easy to check.
    de gustibus et coloribus non est disputandum -- Wiktionary

  10. #10
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    7,051

    Re: Are pasted commands not remembered?

    Quote Originally Posted by vasa1 View Post
    @sudodus, can there be any bad effects to running sync in the context you describe?
    No, sync means to write buffers to disk now (instead of waiting until the system thinks it has time for it), so it should have no bad effect. In this case it should write the history to to /.bash_history.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •