1

I want to make an alias for fixing my previous commands easily.

Using alias fix="fc -e nano" works, but I'd love to use sublime text with this. However, using fc -e subl only brings a blank editor.

I understand that nano only opens up /tmp/bash-fc.PUKKW8. I can force sublime text to open this file manually, but can't figure out a way to open it through fc. Is there a way to do this?

jesse_b
  • 35,934
  • 12
  • 91
  • 140
a3y3
  • 85
  • 8

1 Answers1

2

set the FCEDIT variable:

FCEDIT="subl -w"
fc

Add it in your ~/.bashrc to enable autostart.

a3y3
  • 85
  • 8
GAD3R
  • 63,407
  • 31
  • 131
  • 192
  • This has the same effect as `fc -e subl`. I think this is due to the fact that subl starts in the background. – a3y3 Mar 11 '20 at 17:52
  • 1
    Fixed it! I will accept your answer if you change it to `fc -e "subl -w"`! – a3y3 Mar 11 '20 at 17:54