Well then the real question is how do you properly difuse the gas so as not to produce any unwanted thrust?
In space there is never any unwanted thrust. If necessary, you could eject gas at a perpendicular axis, essentially squeezing the spacecraft with no net gain of momentum.
That would be foolish though. You can never afford to waste propulsion fuel.
Any process which produces gas should have a device for capturing and compressing the gas for a future need. Space travel is for conservative people.