Do I need to change my gas pump?

I drive a 1990 ford ranger 2.9L. Every time I turn my truck on it starts right up. But whenever I go to pump gas and I start my truck it starts and then it struggles to stay on and it dies because of low RPM. What's wrong with it

Question iffy when you pump gas as in when you fill up it won't stay running? Or are you depreesing the gas pedal when you are trying to start it if that is the case you don't have to press the gas pedal to start a fuel injected engine… Does it start good when its cold but after it warms up does if not want to idle the is a bad air idle motor round thing on side of intake about size of pill bottle silver color… No if it don't want to run after you put gas in it and after you drive it is ok don't know what try changing fuel filter its under truck on frame rail u tube on how to do it