The bacillus - or rod - is a pervasive cellular morphology among bacteria. Rod-shaped cells elongate without widening by reinforcing their cell wall anisotropically to prevent turgor pressure from inflating cell width. Here, we demonstrate that a constrictive force is also essential for avoiding pressure-driven widening in Gram-positive bacteria. Specifically, super-resolution measurements of the nonlinear mechanical properties of the cell wall revealed that across a range of turgor pressure cell elongation directly causes width constriction, similar to a "finger trap" toy. As predicted by theory, this property depends on cell-wall anisotropy and is precisely correlated with the cell's ability to maintain a rod shape. Furthermore, the acute non-linearities in the dependence between cell length and width deformation result in a negative-feedback mechanism that confers cell-width homeostasis. That is, the Gram-positive cell wall is a "smart material" whose exotic mechanical properties are exquisitely adapted to execute cellular morphogenesis.