Animals routinely use autogenous movement to regulate the information encoded by their sensory systems. Weakly electric fish use fore-aft movements to regulate visual and electrosensory feedback as they maintain position within a moving refuge. During refuge tracking, fish produce two categories of movements: smooth pursuit that is approximately linear in its relation to the movement of the refuge and ancillary active sensing movements that are nonlinear. We identified four categories of nonlinear movements which we termed scanning, wiggle, drift, and reset. To examine the relations between sensory cues and production of both linear smooth pursuit and nonlinear active sensing movements, we altered visual and electrosensory cues for refuge tracking and measured the fore-aft movements of the fish. Specifically, we altered the length and structure of the refuge and performed experiments with light and in complete darkness. Linear measures of tracking performance were better for shorter refuges (less than a body length) than longer ones (> 1.5 body lengths). The magnitude of nonlinear active sensing movements was strongly modulated by light cues but also increased as a function of both longer refuge length and decreased features. Specifically, fish shifted swimming movements from smooth pursuit to scanning when tracking in dark conditions. Finally, fish appear to use nonlinear movements as an alternate tracking strategy in longer refuges: the fish may use more drifts and resets to avoid exiting the ends of the refuge.