Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ZLE widget to run gdb on command line



On Oct 6, 10:52am, Chris Johnson wrote:
}
}    print -s ${(z)BUFFER}
}    BUFFER="gdb !!0 -x =(echo run !!1*)"
}    zle expand-history
}    zle accept-line

This is a useful idea, but you have a whole function scope to play with.
No need to resort to expanding strings from the history.

  set -- "${(@z)BUFFER}"
  BUFFER="gdb $argv[1] -x =(print -r run ${(q)argv[2-]})"
  zle accept-line

If you want the original line to appear in the history, insert

  print -s -- "$@"

after the "set" command.



Messages sorted by: Reverse Date, Date, Thread, Author