1-methylimidazole catalyzed silylation of Resorufin dyestuff by GPTMS. NMR/FT-IR spectroscopies confirmed the GPTMS epoxy-ring opening reaction. SEM/AFM microscopy was employed to determine morphology of the treated cotton samples. The GPTMS–Resorufin sol retains its halochromic behavior. Hybrid GPTMS-Resorufin sol-gel derivative was used as pH sensor fabric coating.